home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gnuplot.idb / usr / freeware / info / gnuplot.info.z / gnuplot.info
Text File  |  2002-01-08  |  327KB  |  7,911 lines

  1. This file is gnuplot.info created by doc2info from ./gnuplot.doc.
  2.  
  3. START-INFO-DIR-ENTRY
  4. * Gnuplot: (gnuplot).           Gnuplot plotting program
  5. END-INFO-DIR-ENTRY
  6.  
  7. 
  8. File: gnuplot.info, Node: Top, Prev: (dir), Next: gnuplot, Up: (dir)
  9.  
  10. gnuplot
  11. *******
  12.  
  13.  
  14. * Menu:
  15.  
  16. * gnuplot::
  17. * Commands::
  18. * Graphical User Interfaces::
  19. * Bugs::
  20.  
  21. 
  22. File: gnuplot.info, Node: gnuplot, Prev: Top, Up: Top, Next: Copyright
  23.  
  24.  
  25. * Menu:
  26.  
  27. * Copyright::
  28. * Introduction::
  29. * Seeking-assistance::
  30. * What's New in version 3.7::
  31. * Batch/Interactive Operation::
  32. * Command-line-editing::
  33. * Comments::
  34. * Coordinates::
  35. * Environment::
  36. * Expressions::
  37. * Glossary::
  38. * Plotting::
  39. * Start-up::
  40. * Substitution::
  41. * Syntax::
  42. * Time/Date data::
  43.  
  44. 
  45. File: gnuplot.info, Node: Copyright, Prev: gnuplot, Up: gnuplot, Next: Introduction
  46.  
  47.        Copyright (C) 1986 - 1993, 1998   Thomas Williams, Colin Kelley
  48.  
  49.  Permission to use, copy, and distribute this software and its
  50.  documentation for any purpose with or without fee is hereby granted,
  51.  provided that the above copyright notice appear in all copies and
  52.  that both that copyright notice and this permission notice appear
  53.  in supporting documentation.
  54.  
  55.  Permission to modify the software is granted, but not the right to
  56.  distribute the complete modified source code.  Modifications are to
  57.  be distributed as patches to the released version.  Permission to
  58.  distribute binaries produced by compiling modified sources is granted,
  59.  provided you
  60.    1. distribute the corresponding source modifications from the
  61.     released version in the form of a patch file along with the binaries,
  62.    2. add special version identification to distinguish your version
  63.     in addition to the base release version number,
  64.    3. provide your name and address as the primary contact for the
  65.     support of your modified version, and
  66.    4. retain our contact information in regard to use of the base
  67.     software.
  68.  Permission to distribute the released version of the source code along
  69.  with corresponding source modifications in the form of a patch file is
  70.  granted with same provisions 2 through 4 for binary distributions.
  71.  
  72.  This software is provided "as is" without express or implied warranty
  73.  to the extent permitted by applicable law.
  74.  
  75.  
  76.        AUTHORS
  77.  
  78.        Original Software:
  79.           Thomas Williams,  Colin Kelley.
  80.  
  81.        Gnuplot 2.0 additions:
  82.           Russell Lang, Dave Kotz, John Campbell.
  83.  
  84.        Gnuplot 3.0 additions:
  85.           Gershon Elber and many others.
  86.  
  87. 
  88. File: gnuplot.info, Node: Introduction, Prev: Copyright, Up: gnuplot, Next: Seeking-assistance
  89.  
  90.  `gnuplot` (*note gnuplot:: ) is a command-driven interactive function and data
  91.  plotting program. It is case sensitive (commands and function names written in
  92.  lowercase are not the same as those written in CAPS).  All command names may
  93.  be abbreviated as long as the abbreviation is not ambiguous.  Any number of
  94.  commands may appear on a line (with the exception that `load` (*note load:: )
  95.  or  `call` (*note call:: ) must be the final command), separated by semicolons
  96.  (;).  Strings are indicated with quotes. They may be either single or double
  97.  quotation marks, e.g.,
  98.  
  99.        load "filename"
  100.        cd 'dir'
  101.  
  102.  although there are some subtle differences (see `syntax` (*note Syntax:: ) for
  103.  more details).
  104.  
  105.  Any command-line arguments are assumed to be names of files containing
  106.  `gnuplot` commands, with the exception of standard X11 arguments, which are
  107.  processed first.  Each file is loaded with the `load` command, in the order
  108.  specified.  `gnuplot` exits after the last file is processed.  When no load
  109.  files are named, `gnuplot` enters into an interactive mode.  The special
  110.  filename "-" is used to denote standard input.  See "help batch/interactive"
  111.  for more details.
  112.  
  113.  Many `gnuplot` commands have multiple options.  These options must appear in
  114.  the proper order, although unwanted ones may be omitted in most cases.  Thus
  115.  if the entire command is "command a b c", then "command a c" will probably
  116.  work, but "command c a" will fail.
  117.  
  118.  Commands may extend over several input lines by ending each line but the last
  119.  with a backslash (\).  The backslash must be the _last_ character on each
  120.  line.  The effect is as if the backslash and newline were not there.  That
  121.  is, no white space is implied, nor is a comment terminated.  Therefore,
  122.  commenting out a continued line comments out the entire command (see
  123.  `comment`).  But note that if an error occurs somewhere on a multi-line
  124.  command, the parser may not be able to locate precisely where the error is
  125.  and in that case will not necessarily point to the correct line.
  126.  
  127.  In this document, curly braces ({}) denote optional arguments and a vertical
  128.  bar (|) separates mutually exclusive choices.  `gnuplot` keywords or `help`
  129.  (*note help:: ) topics are indicated by backquotes or `boldface` (where
  130.  available).  Angle brackets (<>) are used to mark replaceable tokens.  In many
  131.  cases, a default value of the token will be taken for optional arguments if
  132.  the token is omitted, but these cases are not always denoted with braces
  133.  around the angle brackets.
  134.  
  135.  For on-line help on any topic, type `help` followed by the name of the topic
  136.  or just `help` or `?` to get a menu of available topics.
  137.  
  138.  The new `gnuplot` user should begin by reading about `plotting`
  139.  (*note Plotting:: ) (if on-line, type `help plotting`).
  140.  
  141.  
  142. 
  143. File: gnuplot.info, Node: Seeking-assistance, Prev: Introduction, Up: gnuplot, Next: What's New in version 3.7
  144.  
  145.  There is a mailing list for `gnuplot` (*note gnuplot:: ) users.  Note,
  146.  however, that the newsgroup       comp.graphics.apps.gnuplot is identical to
  147.  the mailing list (they both carry the same set of messages). We prefer that
  148.  you read the messages through the newsgroup rather than subscribing to the
  149.  mailing list.  Administrative requests should be sent to
  150.        majordomo@dartmouth.edu Send a message with the body (not the subject)
  151.  consisting of the single word "help" (without the quotes) for more details.
  152.  
  153.  The address for mailing to list members is:
  154.        info-gnuplot@dartmouth.edu
  155.  
  156.  Bug reports and code contributions should be mailed to:
  157.        bug-gnuplot@dartmouth.edu
  158.  
  159.  The list of those interested in beta-test versions is:
  160.        info-gnuplot-beta@dartmouth.edu
  161.  
  162.  There is also a World Wide Web page with up-to-date information, including
  163.  known bugs:
  164.        http://www.cs.dartmouth.edu/gnuplot_info.html
  165.  
  166.  Before seeking help, please check the
  167.  FAQ (Frequently Asked Questions) list.
  168.  If you do not have a copy of the FAQ, you may request a copy by email from
  169.  the Majordomo address above, ftp a copy from
  170.        ftp://ftp.ucc.ie/pub/gnuplot/faq,
  171.        ftp://ftp.gnuplot.vt.edu/pub/gnuplot/faq,
  172.  or see the WWW `gnuplot` page.
  173.  
  174.  When posting a question, please include full details of the version of
  175.  `gnuplot`, the machine, and operating system you are using.  A _small_ script
  176.  demonstrating the problem may be useful.  Function plots are preferable to
  177.  datafile plots.  If email-ing to info-gnuplot, please state whether or not
  178.  you are subscribed to the list, so that users who use news will know to email
  179.  a reply to you.  There is a form for such postings on the WWW site.
  180.  
  181. 
  182. File: gnuplot.info, Node: What's New in version 3.7, Prev: Seeking-assistance, Up: gnuplot, Next: Batch/Interactive Operation
  183.  
  184.  Gnuplot version 3.7 contains many new features.  This section gives a partial
  185.  list and links to the new items in no particular order.
  186.  
  187.  1. `fit f(x) 'file' via` uses the Marquardt-Levenberg method to fit data.
  188.  (This is only slightly different from the `gnufit` patch available for 3.5.)
  189.  
  190.  2. Greatly expanded `using` (*note using:: ) command.  See plot using.
  191.  
  192.  3. `set timefmt` (*note timefmt:: ) allows for the use of dates as input and
  193.  output for time series plots.  See `Time/Date data` and timedat.dem.
  194.  
  195.  4. Multiline labels and font selection in some drivers.
  196.  
  197.  5. Minor (unlabeled) tics.  See `set mxtics` (*note mxtics:: ).
  198.  
  199.  6. `key` (*note key:: ) options for moving the key box in the page (and even
  200.  outside of the plot), putting a title on it and a box around it, and
  201.  more.  See `set key`.
  202.  
  203.  7. Multiplots on a single logical page with `set multiplot`
  204.  (*note multiplot:: ).
  205.  
  206.  8. Enhanced `postscript` (*note postscript:: ) driver with super/subscripts
  207.  and font changes. (This was a separate driver (`enhpost`) that was available
  208.  as a patch for 3.5.)
  209.  
  210.  9. Second axes:  use the top and right axes independently of the bottom and
  211.  left, both for plotting and labels.  See `plot` (*note plot:: ).
  212.  
  213.  10. Special datafile names `'-'` and `""`.  See `plot special-filenames`
  214.  (*note special-filenames:: ).
  215.  
  216.  11. Additional coordinate systems for labels and arrows.  See `coordinates`
  217.  (*note Coordinates:: ).
  218.  
  219.  12. `set size` (*note size:: ) can try to plot with a specified aspect ratio.
  220.  
  221.  13. `set missing` (*note missing:: ) now treats missing data correctly.
  222.  
  223.  14. The `call` (*note call:: ) command:  `load` (*note load:: ) with
  224.  arguments.
  225.  
  226.  15. More flexible `range` commands with `reverse` and `writeback` keywords.
  227.  
  228.  16. `set encoding` (*note encoding:: ) for multi-lingual encoding.
  229.  
  230.  17. New `x11` (*note x11:: ) driver with persistent and multiple windows.
  231.  
  232.  18. New plotting styles: `xerrorbars` (*note xerrorbars:: ),  `histeps`
  233.  (*note histeps:: ),  `financebars` (*note financebars:: ) and more. See `set
  234.  style` (*note style:: ).
  235.  
  236.  19. New tic label formats, including `"%l %L"` which uses the mantissa and
  237.  exponents to a given base for labels.  See `set format` (*note format:: ).
  238.  
  239.  20. New drivers, including `cgm` (*note cgm:: ) for inclusion into MS-Office
  240.  applications and `gif` for serving plots to the WEB.
  241.  
  242.  21. Smoothing and spline-fitting options for `plot`.  See `plot smooth`
  243.  (*note smooth:: ).
  244.  
  245.  22. `set margin` (*note margin:: ) and  `set origin` (*note origin:: ) give
  246.  much better control over where a graph appears on the page.
  247.  
  248.  23. `set border` (*note border:: ) now controls each border individually.
  249.  
  250.  24. The new commands `if` (*note if:: ) and  `reread` (*note reread:: ) allow
  251.  command loops.
  252.  
  253.  25. Point styles and sizes, line types and widths can be specified on the
  254.  `plot` command.  Line types and widths can also be specified for grids,
  255.  borders, tics and arrows.  See `plot with` (*note with:: ).  Furthermore these
  256.  types may be combined and stored for further use.  See `set linestyle`
  257.  (*note linestyle:: ).
  258.  
  259.  26. Text (labels, tic labels, and the time stamp) can be written vertically
  260.  by those terminals capable of doing so.
  261.  
  262. 
  263. File: gnuplot.info, Node: Batch/Interactive Operation, Prev: What's New in version 3.7, Up: gnuplot, Next: Command-line-editing
  264.  
  265.  `gnuplot` (*note gnuplot:: ) may be executed in either batch or interactive
  266.  modes, and the two may even be mixed together on many systems.
  267.  
  268.  Any command-line arguments are assumed to be names of files containing
  269.  `gnuplot` commands (with the exception of standard X11 arguments, which are
  270.  processed first).  Each file is loaded with the `load` (*note load:: )
  271.  command, in the order specified.  `gnuplot` exits after the last file is
  272.  processed.  When no load files are named, `gnuplot` enters into an interactive
  273.  mode.  The special filename "-" is used to denote standard input.
  274.  
  275.  Both the `exit` (*note exit:: ) and  `quit` (*note quit:: ) commands terminate
  276.  the current command file and `load` the next one, until all have been
  277.  processed.
  278.  
  279.  Examples:
  280.  
  281.  To launch an interactive session:
  282.        gnuplot
  283.  
  284.  To launch a batch session using two command files "input1" and "input2":
  285.        gnuplot input1 input2
  286.  
  287.  To launch an interactive session after an initialization file "header" and
  288.  followed by another command file "trailer":
  289.        gnuplot header - trailer
  290.  
  291. 
  292. File: gnuplot.info, Node: Command-line-editing, Prev: Batch/Interactive Operation, Up: gnuplot, Next: Comments
  293.  
  294.  Command-line editing is supported by the Unix, Atari, VMS, MS-DOS and OS/2
  295.  versions of `gnuplot` (*note gnuplot:: ).  Also, a history mechanism allows
  296.  previous commands to be edited and re-executed.  After the command line has
  297.  been edited, a newline or carriage return will enter the entire line without
  298.  regard to where the cursor is positioned.
  299.  
  300.  (The readline function in `gnuplot` is not the same as the readline used in
  301.  GNU Bash and GNU Emacs.  If the GNU version is desired, it may be selected
  302.  instead of the `gnuplot` version at compile time.)
  303.  
  304.  
  305.  The editing commands are as follows:
  306.  
  307.        `Line-editing`:
  308.  
  309.        ^B    moves back a single character.
  310.        ^F    moves forward a single character.
  311.        ^A    moves to the beginning of the line.
  312.        ^E    moves to the end of the line.
  313.        ^H    and DEL delete the previous character.
  314.        ^D    deletes the current character.
  315.        ^K    deletes from current position to the end of line.
  316.        ^L,^R redraws line in case it gets trashed.
  317.        ^U    deletes the entire line.
  318.        ^W    deletes the last word.
  319.  
  320.        `History`:
  321.  
  322.        ^P    moves back through history.
  323.        ^N    moves forward through history.
  324.  
  325.  On the IBM PC, the use of a TSR program such as DOSEDIT or CED may be desired
  326.  for line editing.  The default makefile assumes that this is the case;  by
  327.  default `gnuplot` will be compiled with no line-editing capability.  If you
  328.  want to use `gnuplot`'s line editing, set READLINE in the makefile and add
  329.  readline.obj to the link file.  The following arrow keys may be used on the
  330.  IBM PC and Atari versions if readline is used:
  331.  
  332.        Left  Arrow      - same as ^B.
  333.        Right Arrow      - same as ^F.
  334.        Ctrl Left  Arrow - same as ^A.
  335.        Ctrl Right Arrow - same as ^E.
  336.        Up    Arrow      - same as ^P.
  337.        Down  Arrow      - same as ^N.
  338.  
  339.  The Atari version of readline defines some additional key aliases:
  340.  
  341.        Undo            - same as ^L.
  342.        Home            - same as ^A.
  343.        Ctrl Home       - same as ^E.
  344.        Esc             - same as ^U.
  345.        Help            - `help` (*note help:: ) plus return.       Ctrl Help
  346.        - `help `.
  347.  
  348.  
  349. 
  350. File: gnuplot.info, Node: Comments, Prev: Command-line-editing, Up: gnuplot, Next: Coordinates
  351.  
  352.  Comments are supported as follows: a `#` may appear in most places in a line
  353.  and `gnuplot` (*note gnuplot:: ) will ignore the rest of the line.  It will
  354.  not have this effect inside quotes, inside numbers (including complex
  355.  numbers), inside command substitutions, etc.  In short, it works anywhere it
  356.  makes sense to work.
  357.  
  358.  
  359. 
  360. File: gnuplot.info, Node: Coordinates, Prev: Comments, Up: gnuplot, Next: Environment
  361.  
  362.  The commands `set arrow` (*note arrow:: ),  `set key` (*note key:: ), and
  363.   `set label` (*note label:: ) allow you to draw something at an arbitrary
  364.  position on the graph.  This position is specified by the syntax:
  365.  
  366.        {<system>} <x>, {<system>} <y> {,{<system>} <z>}
  367.  
  368.  Each <system> can either be `first`, `second`, `graph` or `screen`.
  369.  
  370.  `first` places the x, y, or z coordinate in the system defined by the left
  371.  and bottom axes; `second` places it in the system defined by the second axes
  372.  (top and right); `graph` specifies the area within the axes---0,0 is bottom
  373.  left and 1,1 is top right (for splot, 0,0,0 is bottom left of plotting area;
  374.  use negative z to get to the base---see `set ticslevel` (*note ticslevel:: ));
  375.  and screen specifies the screen area (the entire area---not just the portion
  376.  selected by `set size` (*note size:: )), with 0,0 at bottom left and 1,1 at
  377.  top right.
  378.  
  379.  If the coordinate system for x is not specified, `first` is used.  If the
  380.  system for y is not specified, the one used for x is adopted.
  381.  
  382.  If one (or more) axis is timeseries, the appropriate coordinate should
  383.  be given as a quoted time string according to the `timefmt` (*note timefmt:: )
  384.  format string. See `set xdata` (*note xdata:: ) and set timefmt.  .  `gnuplot`
  385.  (*note gnuplot:: ) will also accept an integer expression, which will be
  386.  interpreted as seconds from 1 January 2000.
  387.  
  388.  
  389. 
  390. File: gnuplot.info, Node: Environment, Prev: Coordinates, Up: gnuplot, Next: Expressions
  391.  
  392.  A number of shell environment variables are understood by `gnuplot`
  393.  (*note gnuplot:: ).  None of these are required, but may be useful.
  394.  
  395.  If GNUTERM is defined, it is used as the name of the terminal type to be
  396.  used.  This overrides any terminal type sensed by `gnuplot` on start-up, but
  397.  is itself overridden by the .gnuplot (or equivalent) start-up file (see
  398.  `start-up`) and, of course, by later explicit changes.
  399.  
  400.  On Unix, AmigaOS, AtariTOS, MS-DOS and OS/2, GNUHELP may be defined to be the
  401.  pathname of the HELP file (gnuplot.gih).
  402.  
  403.  On VMS, the logical name GNUPLOT$HELP should be defined as the name of the
  404.  help library for `gnuplot`.  The `gnuplot` help can be put inside any system
  405.  help library, allowing access to help from both within and outside `gnuplot`
  406.  if desired.
  407.  
  408.  On Unix, HOME is used as the name of a directory to search for a .gnuplot
  409.  file if none is found in the current directory.  On AmigaOS, AtariTOS,
  410.  MS-DOS and OS/2, gnuplot is used.  On VMS, SYS$LOGIN: is used. See `help
  411.  (*note help:: ) start-up`.
  412.  
  413.  On Unix, PAGER is used as an output filter for help messages.
  414.  
  415.  On Unix, AtariTOS and AmigaOS, SHELL is used for the `shell` (*note shell:: )
  416.  command.  On MS-DOS and OS/2, COMSPEC is used for the `shell` command.
  417.  
  418.  On MS-DOS, if the BGI or Watcom interface is used, PCTRM is used to tell
  419.  the maximum resolution supported by your monitor by setting it to
  420.  S<max. horizontal resolution>. E.g. if your monitor's maximum resolution is
  421.  800x600, then use:
  422.        set PCTRM=S800
  423.  If PCTRM is not set, standard VGA is used.
  424.  
  425.  FIT_SCRIPT may be used to specify a `gnuplot` command to be executed when a
  426.  fit is interrupted---see `fit` (*note fit:: ).  FIT_LOG specifies the filename
  427.  of the logfile maintained by fit.
  428.  
  429.  
  430. 
  431. File: gnuplot.info, Node: Expressions, Prev: Environment, Up: gnuplot, Next: Functions
  432.  
  433.  In general, any mathematical expression accepted by C, FORTRAN, Pascal, or
  434.  BASIC is valid.  The precedence of these operators is determined by the
  435.  specifications of the C programming language.  White space (spaces and tabs)
  436.  is ignored inside expressions.
  437.  
  438.  Complex constants are expressed as {<real>,<imag>}, where <real> and <imag>
  439.  must be numerical constants.  For example, {3,2} represents 3 + 2i; {0,1}
  440.  represents 'i' itself.  The curly braces are explicitly required here.
  441.  
  442.  Note that gnuplot uses both "real" and "integer" arithmetic, like FORTRAN and
  443.  C.  Integers are entered as "1", "-10", etc; reals as "1.0", "-10.0", "1e1",
  444.  3.5e-1, etc.  The most important difference between the two forms is in
  445.  division: division of integers truncates: 5/2 = 2; division of reals does
  446.  not: 5.0/2.0 = 2.5.  In mixed expressions, integers are "promoted" to reals
  447.  before evaluation: 5/2e0 = 2.5.  The result of division of a negative integer
  448.  by a positive one may vary among compilers.  Try a test like "print -5/2" to
  449.  determine if your system chooses -2 or -3 as the answer.
  450.  
  451.  The integer expression "1/0" may be used to generate an "undefined" flag,
  452.  which causes a point to ignored; the `ternary` (*note Ternary:: ) operator
  453.  gives an example.
  454.  
  455.  The real and imaginary parts of complex expressions are always real, whatever
  456.  the form in which they are entered: in {3,2} the "3" and "2" are reals, not
  457.  integers.
  458.  
  459. * Menu:
  460.  
  461. * Functions::
  462. * Operators::
  463. * User-defined::
  464.  
  465. 
  466. File: gnuplot.info, Node: Functions, Prev: Expressions, Up: Expressions, Next: abs
  467.  
  468.  The functions in `gnuplot` (*note gnuplot:: ) are the same as the
  469.  corresponding functions in the Unix math library, except that all functions
  470.  accept integer, real, and complex arguments, unless otherwise noted.
  471.  
  472.  For those functions that accept or return angles that may be given in either
  473.  degrees or radians (sin(x), cos(x), tan(x), asin(x), acos(x), atan(x),
  474.  atan2(x) and arg(z)), the unit may be selected by `set angles`
  475.  (*note angles:: ), which defaults to radians.
  476.  
  477.  
  478. * Menu:
  479.  
  480. * abs::
  481. * acos::
  482. * acosh::
  483. * arg::
  484. * asin::
  485. * asinh::
  486. * atan::
  487. * atan2::
  488. * atanh::
  489. * besj0::
  490. * besj1::
  491. * besy0::
  492. * besy1::
  493. * ceil::
  494. * cos::
  495. * cosh::
  496. * erf::
  497. * erfc::
  498. * exp::
  499. * floor::
  500. * gamma::
  501. * ibeta::
  502. * inverf::
  503. * igamma::
  504. * imag::
  505. * invnorm::
  506. * int::
  507. * lgamma::
  508. * log::
  509. * log10::
  510. * norm::
  511. * rand::
  512. * real::
  513. * sgn::
  514. * sin::
  515. * sinh::
  516. * sqrt::
  517. * tan::
  518. * tanh::
  519. * column::
  520. * tm_hour::
  521. * tm_mday::
  522. * tm_min::
  523. * tm_mon::
  524. * tm_sec::
  525. * tm_wday::
  526. * tm_yday::
  527. * tm_year::
  528. * valid::
  529.  
  530. 
  531. File: gnuplot.info, Node: abs, Prev: Functions, Up: Functions, Next: acos
  532.  
  533.  The `abs(x)` function returns the absolute value of its argument.  The
  534.  returned value is of the same type as the argument.
  535.  
  536.  For complex arguments, abs(x) is defined as the length of x in the complex
  537.  plane [i.e.,  sqrt(real(x)**2 + imag(x)**2) ].
  538.  
  539. 
  540. File: gnuplot.info, Node: acos, Prev: abs, Up: Functions, Next: acosh
  541.  
  542.  The `acos(x)` function returns the arc cosine (inverse cosine) of its
  543.  argument.  `acos` returns its argument in radians or degrees, as selected by
  544.  `set angles` (*note angles:: ).
  545.  
  546.  
  547. 
  548. File: gnuplot.info, Node: acosh, Prev: acos, Up: Functions, Next: arg
  549.  
  550.  The `acosh(x)` function returns the inverse hyperbolic cosine of its argument
  551.  in radians.
  552.  
  553. 
  554. File: gnuplot.info, Node: arg, Prev: acosh, Up: Functions, Next: asin
  555.  
  556.  The `arg(x)` function returns the phase of a complex number in radians or
  557.  degrees, as selected by `set angles` (*note angles:: ).
  558.  
  559.  
  560. 
  561. File: gnuplot.info, Node: asin, Prev: arg, Up: Functions, Next: asinh
  562.  
  563.  The `asin(x)` function returns the arc sin (inverse sin) of its argument.
  564.  `asin` returns its argument in radians or degrees, as selected by `set
  565.  angles`.
  566.  
  567. 
  568. File: gnuplot.info, Node: asinh, Prev: asin, Up: Functions, Next: atan
  569.  
  570.  The `asinh(x)` function returns the inverse hyperbolic sin of its argument in
  571.  radians.
  572.  
  573. 
  574. File: gnuplot.info, Node: atan, Prev: asinh, Up: Functions, Next: atan2
  575.  
  576.  The `atan(x)` function returns the arc tangent (inverse tangent) of its
  577.  argument.  `atan` returns its argument in radians or degrees, as selected by
  578.  `set angles` (*note angles:: ).
  579.  
  580.  
  581. 
  582. File: gnuplot.info, Node: atan2, Prev: atan, Up: Functions, Next: atanh
  583.  
  584.  The `atan2(y,x)` function returns the arc tangent (inverse tangent) of the
  585.  ratio of the real parts of its arguments.  `atan2` returns its argument in
  586.  radians or degrees, as selected by `set angles` (*note angles:: ), in the
  587.  correct quadrant.
  588.  
  589.  
  590. 
  591. File: gnuplot.info, Node: atanh, Prev: atan2, Up: Functions, Next: besj0
  592.  
  593.  The `atanh(x)` function returns the inverse hyperbolic tangent of its
  594.  argument in radians.
  595.  
  596. 
  597. File: gnuplot.info, Node: besj0, Prev: atanh, Up: Functions, Next: besj1
  598.  
  599.  The `besj0(x)` function returns the j0th Bessel function of its argument.
  600.  `besj0` expects its argument to be in radians.
  601.  
  602. 
  603. File: gnuplot.info, Node: besj1, Prev: besj0, Up: Functions, Next: besy0
  604.  
  605.  The `besj1(x)` function returns the j1st Bessel function of its argument.
  606.  `besj1` expects its argument to be in radians.
  607.  
  608. 
  609. File: gnuplot.info, Node: besy0, Prev: besj1, Up: Functions, Next: besy1
  610.  
  611.  The `besy0` function returns the y0th Bessel function of its argument.
  612.  `besy0` expects its argument to be in radians.
  613.  
  614. 
  615. File: gnuplot.info, Node: besy1, Prev: besy0, Up: Functions, Next: ceil
  616.  
  617.  The `besy1(x)` function returns the y1st Bessel function of its argument.
  618.  `besy1` expects its argument to be in radians.
  619.  
  620. 
  621. File: gnuplot.info, Node: ceil, Prev: besy1, Up: Functions, Next: cos
  622.  
  623.  The `ceil(x)` function returns the smallest integer that is not less than its
  624.  argument.  For complex numbers, `ceil` returns the smallest integer not less
  625.  than the real part of its argument.
  626.  
  627. 
  628. File: gnuplot.info, Node: cos, Prev: ceil, Up: Functions, Next: cosh
  629.  
  630.  The `cos(x)` function returns the cosine of its argument.  `cos` accepts its
  631.  argument in radians or degrees, as selected by `set angles`
  632.  (*note angles:: ).
  633.  
  634.  
  635. 
  636. File: gnuplot.info, Node: cosh, Prev: cos, Up: Functions, Next: erf
  637.  
  638.  The `cosh(x)` function returns the hyperbolic cosine of its argument.  `cosh`
  639.  expects its argument to be in radians.
  640.  
  641. 
  642. File: gnuplot.info, Node: erf, Prev: cosh, Up: Functions, Next: erfc
  643.  
  644.  The `erf(x)` function returns the error function of the real part of its
  645.  argument.  If the argument is a complex value, the imaginary component is
  646.  ignored.
  647.  
  648. 
  649. File: gnuplot.info, Node: erfc, Prev: erf, Up: Functions, Next: exp
  650.  
  651.  The `erfc(x)` function returns 1.0 - the error function of the real part of
  652.  its argument.  If the argument is a complex value, the imaginary component is
  653.  ignored.
  654.  
  655. 
  656. File: gnuplot.info, Node: exp, Prev: erfc, Up: Functions, Next: floor
  657.  
  658.  The `exp(x)` function returns the exponential function of its argument (`e`
  659.  raised to the power of its argument).  On some implementations (notably
  660.  suns), exp(-x) returns undefined for very large x.  A user-defined function
  661.  like safe(x) = x<-100 ? 0 : exp(x) might prove useful in these cases.
  662.  
  663. 
  664. File: gnuplot.info, Node: floor, Prev: exp, Up: Functions, Next: gamma
  665.  
  666.  The `floor(x)` function returns the largest integer not greater than its
  667.  argument.  For complex numbers, `floor` returns the largest integer not
  668.  greater than the real part of its argument.
  669.  
  670. 
  671. File: gnuplot.info, Node: gamma, Prev: floor, Up: Functions, Next: ibeta
  672.  
  673.  The `gamma(x)` function returns the gamma function of the real part of its
  674.  argument.  For integer n, gamma(n+1) = n!.  If the argument is a complex
  675.  value, the imaginary component is ignored.
  676.  
  677. 
  678. File: gnuplot.info, Node: ibeta, Prev: gamma, Up: Functions, Next: inverf
  679.  
  680.  The `ibeta(p,q,x)` function returns the incomplete beta function of the real
  681.  parts of its arguments. p, q > 0 and x in [0:1].  If the arguments are
  682.  complex, the imaginary components are ignored.
  683.  
  684. 
  685. File: gnuplot.info, Node: inverf, Prev: ibeta, Up: Functions, Next: igamma
  686.  
  687.  The `inverf(x)` function returns the inverse error function of the real part
  688.  of its argument.
  689.  
  690. 
  691. File: gnuplot.info, Node: igamma, Prev: inverf, Up: Functions, Next: imag
  692.  
  693.  The `igamma(a,x)` function returns the incomplete gamma function of the real
  694.  parts of its arguments.  a > 0 and x >= 0.  If the arguments are complex,
  695.  the imaginary components are ignored.
  696.  
  697. 
  698. File: gnuplot.info, Node: imag, Prev: igamma, Up: Functions, Next: invnorm
  699.  
  700.  The `imag(x)` function returns the imaginary part of its argument as a real
  701.  number.
  702.  
  703. 
  704. File: gnuplot.info, Node: invnorm, Prev: imag, Up: Functions, Next: int
  705.  
  706.  The `invnorm(x)` function returns the inverse normal distribution function of
  707.  the real part of its argument.
  708.  
  709. 
  710. File: gnuplot.info, Node: int, Prev: invnorm, Up: Functions, Next: lgamma
  711.  
  712.  The `int(x)` function returns the integer part of its argument, truncated
  713.  toward zero.
  714.  
  715. 
  716. File: gnuplot.info, Node: lgamma, Prev: int, Up: Functions, Next: log
  717.  
  718.  The `lgamma(x)` function returns the natural logarithm of the gamma function
  719.  of the real part of its argument.  If the argument is a complex value, the
  720.  imaginary component is ignored.
  721.  
  722. 
  723. File: gnuplot.info, Node: log, Prev: lgamma, Up: Functions, Next: log10
  724.  
  725.  The `log(x)` function returns the natural logarithm (base `e`) of its
  726.  argument.
  727.  
  728. 
  729. File: gnuplot.info, Node: log10, Prev: log, Up: Functions, Next: norm
  730.  
  731.  The `log10(x)` function returns the logarithm (base 10) of its argument.
  732.  
  733. 
  734. File: gnuplot.info, Node: norm, Prev: log10, Up: Functions, Next: rand
  735.  
  736.  The `norm(x)` function returns the normal distribution function (or Gaussian)
  737.  of the real part of its argument.
  738.  
  739. 
  740. File: gnuplot.info, Node: rand, Prev: norm, Up: Functions, Next: real
  741.  
  742.  The `rand(x)` function returns a pseudo random number in the interval [0:1]
  743.  using the real part of its argument as a seed.  If seed < 0, the sequence
  744.  is (re)initialized.  If the argument is a complex value, the imaginary
  745.  component is ignored.
  746.  
  747. 
  748. File: gnuplot.info, Node: real, Prev: rand, Up: Functions, Next: sgn
  749.  
  750.  The `real(x)` function returns the real part of its argument.
  751.  
  752. 
  753. File: gnuplot.info, Node: sgn, Prev: real, Up: Functions, Next: sin
  754.  
  755.  The `sgn(x)` function returns 1 if its argument is positive, -1 if its
  756.  argument is negative, and 0 if its argument is 0.  If the argument is a
  757.  complex value, the imaginary component is ignored.
  758.  
  759. 
  760. File: gnuplot.info, Node: sin, Prev: sgn, Up: Functions, Next: sinh
  761.  
  762.  The `sin(x)` function returns the sine of its argument.  `sin` expects its
  763.  argument to be in radians or degrees, as selected by `set angles`
  764.  (*note angles:: ).
  765.  
  766.  
  767. 
  768. File: gnuplot.info, Node: sinh, Prev: sin, Up: Functions, Next: sqrt
  769.  
  770.  The `sinh(x)` function returns the hyperbolic sine of its argument.  `sinh`
  771.  expects its argument to be in radians.
  772.  
  773. 
  774. File: gnuplot.info, Node: sqrt, Prev: sinh, Up: Functions, Next: tan
  775.  
  776.  The `sqrt(x)` function returns the square root of its argument.
  777.  
  778. 
  779. File: gnuplot.info, Node: tan, Prev: sqrt, Up: Functions, Next: tanh
  780.  
  781.  The `tan(x)` function returns the tangent of its argument.  `tan` expects
  782.  its argument to be in radians or degrees, as selected by `set angles`
  783.  (*note angles:: ).
  784.  
  785.  
  786. 
  787. File: gnuplot.info, Node: tanh, Prev: tan, Up: Functions, Next: column
  788.  
  789.  The `tanh(x)` function returns the hyperbolic tangent of its argument.  `tanh`
  790.  expects its argument to be in radians.
  791.  
  792.  A few additional functions are also available.
  793.  
  794.  
  795. 
  796. File: gnuplot.info, Node: column, Prev: tanh, Up: Functions, Next: tm_hour
  797.  
  798.  `column(x)` may be used only in expressions as part of `using`
  799.  (*note using:: ) manipulations to fits or datafile plots.  See `plot datafile
  800.  using`.
  801.  
  802.  
  803. 
  804. File: gnuplot.info, Node: tm_hour, Prev: column, Up: Functions, Next: tm_mday
  805.  
  806.  The `tm_hour` function interprets its argument as a time, in seconds from
  807.  1 Jan 2000.  It returns the hour (an integer in the range 0--23) as a real.
  808.  
  809. 
  810. File: gnuplot.info, Node: tm_mday, Prev: tm_hour, Up: Functions, Next: tm_min
  811.  
  812.  The `tm_mday` function interprets its argument as a time, in seconds from
  813.  1 Jan 2000.  It returns the day of the month (an integer in the range 1--31)
  814.  as a real.
  815.  
  816. 
  817. File: gnuplot.info, Node: tm_min, Prev: tm_mday, Up: Functions, Next: tm_mon
  818.  
  819.  The `tm_min` function interprets its argument as a time, in seconds from
  820.  1 Jan 2000.  It returns the minute (an integer in the range 0--59) as a real.
  821.  
  822. 
  823. File: gnuplot.info, Node: tm_mon, Prev: tm_min, Up: Functions, Next: tm_sec
  824.  
  825.  The `tm_mon` function interprets its argument as a time, in seconds from
  826.  1 Jan 2000.  It returns the month (an integer in the range 1--12) as a real.
  827.  
  828. 
  829. File: gnuplot.info, Node: tm_sec, Prev: tm_mon, Up: Functions, Next: tm_wday
  830.  
  831.  The `tm_sec` function interprets its argument as a time, in seconds from
  832.  1 Jan 2000.  It returns the second (an integer in the range 0--59) as a real.
  833.  
  834. 
  835. File: gnuplot.info, Node: tm_wday, Prev: tm_sec, Up: Functions, Next: tm_yday
  836.  
  837.  The `tm_wday` function interprets its argument as a time, in seconds from
  838.  1 Jan 2000.  It returns the day of the week (an integer in the range 1--7) as
  839.  a real.
  840.  
  841. 
  842. File: gnuplot.info, Node: tm_yday, Prev: tm_wday, Up: Functions, Next: tm_year
  843.  
  844.  The `tm_yday` function interprets its argument as a time, in seconds from
  845.  1 Jan 2000.  It returns the day of the year (an integer in the range 1--366)
  846.  as a real.
  847.  
  848. 
  849. File: gnuplot.info, Node: tm_year, Prev: tm_yday, Up: Functions, Next: valid
  850.  
  851.  The `tm_year` function interprets its argument as a time, in seconds from
  852.  1 Jan 2000.  It returns the year (an integer) as a real.
  853.  
  854. 
  855. File: gnuplot.info, Node: valid, Prev: tm_year, Up: Functions
  856.  
  857.  `valid(x)` may be used only in expressions as part of `using` (*note using:: )
  858.  manipulations to fits or datafile plots.  See `plot datafile using`.
  859.  
  860.  
  861. 
  862. File: gnuplot.info, Node: Operators, Prev: Functions, Up: Expressions, Next: Unary
  863.  
  864.  The operators in `gnuplot` (*note gnuplot:: ) are the same as the
  865.  corresponding operators in the C programming language, except that all
  866.  operators accept integer, real, and complex arguments, unless otherwise
  867.  noted.  The ** operator (exponentiation) is supported, as in FORTRAN.
  868.  
  869.  Parentheses may be used to change order of evaluation.
  870.  
  871. * Menu:
  872.  
  873. * Unary::
  874. * Binary::
  875. * Ternary::
  876.  
  877. 
  878. File: gnuplot.info, Node: Unary, Prev: Operators, Up: Operators, Next: Binary
  879.  
  880.  The following is a list of all the unary operators and their usages:
  881.  
  882.      Symbol      Example    Explanation
  883.        -           -a          unary minus
  884.        +           +a          unary plus (no-operation)
  885.        ~           ~a        * one's complement
  886.        !           !a        * logical negation
  887.        !           a!        * factorial
  888.        $           $3        * call arg/column during `using` (*note using:: )
  889.  manipulation (*) Starred explanations indicate that the operator requires an
  890.  integer argument.
  891.  
  892.  Operator precedence is the same as in Fortran and C.  As in those languages,
  893.  parentheses may be used to change the order of operation.  Thus -2**2 = -4,
  894.  but (-2)**2 = 4.
  895.  
  896.  The factorial operator returns a real number to allow a greater range.
  897.  
  898. 
  899. File: gnuplot.info, Node: Binary, Prev: Unary, Up: Operators, Next: Ternary
  900.  
  901.  The following is a list of all the binary operators and their usages:
  902.  
  903.      Symbol       Example      Explanation
  904.        **          a**b          exponentiation
  905.        *           a*b           multiplication
  906.        /           a/b           division
  907.        %           a%b         * modulo
  908.        +           a+b           addition
  909.        -           a-b           subtraction
  910.        ==          a==b          equality
  911.        !=          a!=b          inequality
  912.        <           a<b           less than
  913.        <=          a<=b          less than or equal to
  914.        >           a>b           greater than
  915.        >=          a>=b          greater than or equal to
  916.        &           a&b         * bitwise AND
  917.        ^           a^b         * bitwise exclusive OR
  918.        |           a|b         * bitwise inclusive OR
  919.        &&          a&&b        * logical AND
  920.        ||          a||b        * logical OR
  921.  
  922.  (*) Starred explanations indicate that the operator requires integer
  923.  arguments.
  924.  
  925.  Logical AND (&&) and OR (||) short-circuit the way they do in C.  That is,
  926.  the second `&&` operand is not evaluated if the first is false; the second
  927.  `||` operand is not evaluated if the first is true.
  928.  
  929. 
  930. File: gnuplot.info, Node: Ternary, Prev: Binary, Up: Operators
  931.  
  932.  There is a single ternary operator:
  933.  
  934.      Symbol       Example      Explanation
  935.        ?:          a?b:c     ternary operation
  936.  
  937.  The ternary operator behaves as it does in C.  The first argument (a), which
  938.  must be an integer, is evaluated.  If it is true (non-zero), the second
  939.  argument (b) is evaluated and returned; otherwise the third argument (c) is
  940.  evaluated and returned.
  941.  
  942.  The ternary operator is very useful both in constructing piecewise functions
  943.  and in plotting points only when certain conditions are met.
  944.  
  945.  Examples:
  946.  
  947.  Plot a function that is to equal sin(x) for 0 <= x < 1, 1/x for 1 <= x < 2,
  948.  and undefined elsewhere:
  949.        f(x) = 0<=x && x<1 ? sin(x) : 1<=x && x<2 ? 1/x : 1/0
  950.        plot f(x)
  951.  Note that `gnuplot` (*note gnuplot:: ) quietly ignores undefined values, so
  952.  the final branch of the function (1/0) will produce no plottable points.  Note
  953.  also that f(x) will be plotted as a continuous function across the
  954.  discontinuity if a line style is used.  To plot it discontinuously, create
  955.  separate functions for the two pieces.  (Parametric functions are also useful
  956.  for this purpose.)
  957.  
  958.  For data in a file, plot the average of the data in columns 2 and 3 against
  959.  the datum in column 1, but only if the datum in column 4 is non-negative:
  960.  
  961.        plot 'file' using 1:( $4<0 ? 1/0 : ($2+$3)/2 )
  962.  
  963.  Please see `plot data-file using` (*note using:: ) for an explanation of the
  964.  using syntax.
  965.  
  966.  
  967. 
  968. File: gnuplot.info, Node: User-defined, Prev: Operators, Up: Expressions
  969.  
  970.  New user-defined variables and functions of one through five variables may
  971.  be declared and used anywhere, including on the `plot` (*note plot:: ) command
  972.  itself.
  973.  
  974.  User-defined function syntax:
  975.        <func-name>( <dummy1> {,<dummy2>} ... {,<dummy5>} ) = <expression>
  976.  
  977.  where <expression> is defined in terms of <dummy1> through <dummy5>.
  978.  
  979.  User-defined variable syntax:
  980.        <variable-name> = <constant-expression>
  981.  
  982.  Examples:
  983.        w = 2
  984.        q = floor(tan(pi/2 - 0.1))
  985.        f(x) = sin(w*x)
  986.        sinc(x) = sin(pi*x)/(pi*x)
  987.        delta(t) = (t == 0)
  988.        ramp(t) = (t > 0) ? t : 0
  989.        min(a,b) = (a < b) ? a : b
  990.        comb(n,k) = n!/(k!*(n-k)!)
  991.        len3d(x,y,z) = sqrt(x*x+y*y+z*z)
  992.        plot f(x) = sin(x*a), a = 0.2, f(x), a = 0.4, f(x)
  993.  
  994.  Note that the variable `pi` is already defined.  But it is in no way magic;
  995.  you may redefine it to be whatever you like.
  996.  
  997.  Valid names are the same as in most programming languages: they must begin
  998.  with a letter, but subsequent characters may be letters, digits, "$", or "_".
  999.  Note, however, that the `fit` (*note fit:: ) mechanism uses several variables
  1000.  with names that begin "FIT_".  It is safest to avoid using such
  1001.  names.  "FIT_LIMIT", however, is one that you may wish to redefine. See the
  1002.  documentation on `fit` for details.
  1003.  
  1004.  
  1005.  See `show functions` (*note functions:: ),  `show variables`
  1006.  (*note variables:: ), and fit.
  1007.  
  1008.  
  1009. 
  1010. File: gnuplot.info, Node: Glossary, Prev: Expressions, Up: gnuplot, Next: Plotting
  1011.  
  1012.  Throughout this document an attempt has been made to maintain consistency of
  1013.  nomenclature.  This cannot be wholly successful because as `gnuplot`
  1014.  (*note gnuplot:: ) has evolved over time, certain command and keyword names
  1015.  have been adopted that preclude such perfection.  This section contains
  1016.  explanations of the way some of these terms are used.
  1017.  
  1018.  A "page" or "screen" is the entire area addressable by `gnuplot`.  On a
  1019.  monitor, it is the full screen; on a plotter, it is a single sheet of paper.
  1020.  
  1021.  A screen may contain one or more "plots".  A plot is defined by an abscissa
  1022.  and an ordinate, although these need not actually appear on it, as well as
  1023.  the margins and any text written therein.
  1024.  
  1025.  A plot contains one "graph".  A graph is defined by an abscissa and an
  1026.  ordinate, although these need not actually appear on it.
  1027.  
  1028.  A graph may contain one or more "lines".  A line is a single function or
  1029.  data set.  "Line" is also a plotting style.  The word will also be used in
  1030.  sense "a line of text".  Presumably the context will remove any ambiguity.
  1031.  
  1032.  The lines on a graph may have individual names.  These may be listed
  1033.  together with a sample of the plotting style used to represent them in
  1034.  the "key", sometimes also called the "legend".
  1035.  
  1036.  The word "title" occurs with multiple meanings in `gnuplot`.  In this
  1037.  document, it will always be preceded by the adjective "plot", "line", or
  1038.  "key" to differentiate among them.
  1039.  
  1040.  A graph may have up to four labelled axes.  Various commands have the name of
  1041.  an axis built into their names, such as `set xlabel` (*note xlabel:: ).  Other
  1042.  commands have one or more axis names as options, such as `set logscale
  1043.  xy`.  The names of the four axes for these usages are "x" for the axis along
  1044.  the bottom border of the plot, "y" for the left border, "x2" for the top
  1045.  border, and "y2" for the right border.  "z" also occurs in commands used with
  1046.  3-d plotting.
  1047.  
  1048.  When discussing data files, the term "record" will be resurrected and used
  1049.  to denote a single line of text in the file, that is, the characters between
  1050.  newline or end-of-record characters.  A "point" is the datum extracted from
  1051.  a single record.  A "datablock" is a set of points from consecutive records,
  1052.  delimited by blank records.  A line, when referred to in the context of a
  1053.  data file, is a subset of a datablock.
  1054.  
  1055. 
  1056. File: gnuplot.info, Node: Plotting, Prev: Glossary, Up: gnuplot, Next: Start-up
  1057.  
  1058.  There are three `gnuplot` (*note gnuplot:: ) commands which actually create a
  1059.  plot:  `plot` (*note plot:: ), `splot` (*note splot:: ) and  `replot`
  1060.  (*note replot:: ).  plot generates 2-d plots, splot generates 3-d plots
  1061.  (actually 2-d projections, of course), and `replot` appends its arguments to
  1062.  the previous `plot` or `splot` and executes the modified command.
  1063.  
  1064.  Much of the general information about plotting can be found in the discussion
  1065.  of `plot`; information specific to 3-d can be found in the `splot` section.
  1066.  
  1067.  `plot` operates in either rectangular or polar coordinates -- see `set polar`
  1068.  (*note polar:: ) for details of the latter.  `splot` operates only in
  1069.  rectangular coordinates, but the `set mapping` (*note mapping:: ) command
  1070.  allows for a few other coordinate systems to be treated.  In addition, the
  1071.  `using` (*note using:: ) option allows both plot and splot to treat almost any
  1072.  coordinate system you'd care to define.
  1073.  
  1074.  `splot` can plot surfaces and contours in addition to points and/or lines.
  1075.  In addition to `splot`, see `set isosamples` (*note isosamples:: ) for
  1076.  information about defining the grid for a 3-d function;  `splot datafile`
  1077.  (*note data-file:: ) for information about the requisite file structure for
  1078.  3-d data values; and `set contour` (*note contour:: ) and set cntrparam` for
  1079.  information about contours.
  1080.  
  1081.  
  1082. 
  1083. File: gnuplot.info, Node: Start-up, Prev: Plotting, Up: gnuplot, Next: Substitution
  1084.  
  1085.  When `gnuplot` (*note gnuplot:: ) is run, it looks for an initialization file
  1086.  to load.  This file is called `.gnuplot` on Unix and AmigaOS systems, and
  1087.  `GNUPLOT.INI` on other systems.  If this file is not found in the current
  1088.  directory, the program will look for it in the home directory (under AmigaOS,
  1089.  Atari(single)TOS, MS-DOS and OS/2, the environment variable `gnuplot` should
  1090.  contain the name of this directory).  Note: if NOCWDRC is defined during the
  1091.  installation, `gnuplot` will not read from the current directory.
  1092.  
  1093.  If the initialization file is found, `gnuplot` executes the commands in it.
  1094.  These may be any legal `gnuplot` commands, but typically they are limited to
  1095.  setting the terminal and defining frequently-used functions or variables.
  1096.  
  1097. 
  1098. File: gnuplot.info, Node: Substitution, Prev: Start-up, Up: gnuplot, Next: Syntax
  1099.  
  1100.  Command-line substitution is specified by a system command enclosed in
  1101.  backquotes.  This command is spawned and the output it produces replaces
  1102.  the name of the command (and backquotes) on the command line.  Some
  1103.  implementations also support pipes;  see `plot data-file special-filenames`
  1104.  (*note special-filenames:: ).
  1105.  
  1106.  Newlines in the output produced by the spawned command are replaced with
  1107.  blanks.
  1108.  
  1109.  Command-line substitution can be used anywhere on the `gnuplot`
  1110.  (*note gnuplot:: ) command line.
  1111.  
  1112.  Example:
  1113.  
  1114.  This will run the program `leastsq` and replace `leastsq` (including
  1115.  backquotes) on the command line with its output:
  1116.        f(x) = `leastsq`
  1117.  
  1118.  or, in VMS
  1119.        f(x) = `run leastsq`
  1120.  
  1121. 
  1122. File: gnuplot.info, Node: Syntax, Prev: Substitution, Up: gnuplot, Next: Time/Date data
  1123.  
  1124.  The general rules of syntax and punctuation in `gnuplot` (*note gnuplot:: )
  1125.  are that keywords and options are order-dependent.  Options and any
  1126.  accompanying parameters are separated by spaces whereas lists and coordinates
  1127.  are separated by commas. Ranges are separated by colons and enclosed in
  1128.  brackets [], text and file names are enclosed in quotes, and a few
  1129.  miscellaneous things are enclosed in parentheses.  Braces {} are used for a
  1130.  few special purposes.
  1131.  
  1132.  Commas are used to separate coordinates on the `set` (*note set-show:: )
  1133.  commands  `arrow` (*note arrow:: ), `key` (*note key:: ), and  `label`
  1134.  (*note label:: ); the list of variables being fitted (the list after the `via`
  1135.  keyword on the `fit` (*note fit:: ) command); lists of discrete contours or
  1136.  the loop parameters which specify them on the `set cntrparam`
  1137.  (*note cntrparam:: ) command; the arguments of the `set` commands `dgrid3d`
  1138.  (*note dgrid3d:: ),  `dummy` (*note dummy:: ),  `isosamples`
  1139.  (*note isosamples:: ),  `offsets` (*note offsets:: ),  `origin`
  1140.  (*note origin:: ), `samples` (*note samples:: ),  `size` (*note size:: ),
  1141.  time, and nd `view` (*note view:: ); lists of tics or the loop parameters
  1142.  which specify them; the offsets for titles and axis labels; parametric
  1143.  functions to be used to calculate the x, y, and z coordinates on the `plot`
  1144.  (*note plot:: ), `replot` (*note replot:: ) and  `splot` (*note splot:: )
  1145.  commands; and the complete sets of keywords specifying individual plots (data
  1146.  sets or functions) on the `plot`, `replot` and `splot` commands.
  1147.  
  1148.  Parentheses are used to delimit sets of explicit tics (as opposed to loop
  1149.  parameters) and to indicate computations in the `using` (*note using:: )
  1150.  filter of the fit, `plot`, `replot` and `splot` commands.
  1151.  
  1152.  (Parentheses and commas are also used as usual in function notation.)
  1153.  
  1154.  Brackets are used to delimit ranges, whether they are given on `set`, `plot`
  1155.  or `splot` commands.
  1156.  
  1157.  Colons are used to separate extrema in `range` specifications (whether they
  1158.  are given on `set`, `plot` or `splot` commands) and to separate entries in
  1159.  the `using` filter of the `plot`, `replot`, `splot` and `fit` commands.
  1160.  
  1161.  Semicolons are used to separate commands given on a single command line.
  1162.  
  1163.  Braces are used in text to be specially processed by some terminals, like
  1164.  `postscript` (*note postscript:: ).  They are also used to denote complex
  1165.  numbers: {3,2} = 3 + 2i.
  1166.  
  1167.  Text may be enclosed in single- or double-quotes.  Backslash processing of
  1168.  sequences like \n (newline) and \345 (octal character code) is performed for
  1169.  double-quoted strings, but not for single-quoted strings.
  1170.  
  1171.  The justification is the same for each line of a multi-line string.  Thus the
  1172.  center-justified string
  1173.        "This is the first line of text.\nThis is the second line."
  1174.  will produce
  1175.                         This is the first line of text.
  1176.                            This is the second line.
  1177.  but
  1178.        'This is the first line of text.\nThis is the second line.'
  1179.  will produce
  1180.            This is the first line of text.\nThis is the second line.
  1181.  
  1182.  Filenames may be entered with either single- or double-quotes.  In this
  1183.  manual the command examples generally single-quote filenames and double-quote
  1184.  other string tokens for clarity.
  1185.  
  1186.  At present you should not embed \n inside {} when using the enhanced option
  1187.  of the postscript terminal.
  1188.  
  1189.  The EEPIC, Imagen, Uniplex, LaTeX, and TPIC drivers allow a newline to be
  1190.  specified by \\ in a single-quoted string or \\\\ in a double-quoted string.
  1191.  
  1192.  Back-quotes are used to enclose system commands for substitution.
  1193.  
  1194. 
  1195. File: gnuplot.info, Node: Time/Date data, Prev: Syntax, Up: gnuplot
  1196.  
  1197.  `gnuplot` (*note gnuplot:: ) supports the use of time and/or date information
  1198.  as input data. This feature is activated by the commands `set xdata time`,
  1199.  `set ydata time`, etc.
  1200.  
  1201.  Internally all times and dates are converted to the number of seconds from
  1202.  the year 2000.  The command `set timefmt` (*note timefmt:: ) defines the
  1203.  format for all inputs: data files, ranges, tics, label positions---in short,
  1204.  anything that accepts a data value must receive it in this format.  Since only
  1205.  one input format can be in force at a given time, all time/date quantities
  1206.  being input at the same time must be presented in the same format.  Thus if
  1207.  both x and y data in a file are time/date, they must be in the same format.
  1208.  
  1209.  The conversion to and from seconds assumes Universal Time (which is the same
  1210.  as Greenwich Standard Time).  There is no provision for changing the time
  1211.  zone or for daylight savings.  If all your data refer to the same time zone
  1212.  (and are all either daylight or standard) you don't need to worry about these
  1213.  things.  But if the absolute time is crucial for your application, you'll
  1214.  need to convert to UT yourself.
  1215.  
  1216.  Commands like `show xrange` (*note xrange:: ) will re-interpret the integer
  1217.  according to `timefmt`.  If you change `timefmt`, and then `show`
  1218.  (*note set-show:: ) the quantity again, it will be displayed in the new
  1219.  `timefmt`.  For that matter, if you give the deactivation command (like `set
  1220.  xdata` (*note xdata:: )), the quantity will be shown in its numerical form.
  1221.  
  1222.  The command `set format` (*note format:: ) defines the format that will be
  1223.  used for tic labels, whether or not the specified axis is time/date.
  1224.  
  1225.  If time/date information is to be plotted from a file, the `using`
  1226.  (*note using:: ) option _must_ be used on the `plot` (*note plot:: ) or
  1227.   `splot` (*note splot:: ) command.  These commands simply use white space to
  1228.  separate columns, but white space may be embedded within the time/date
  1229.  string.  If you use tabs as a separator, some trial-and-error may be necessary
  1230.  to discover how your system treats them.
  1231.  
  1232.  The following example demonstrates time/date plotting.
  1233.  
  1234.  Suppose the file "data" contains records like
  1235.  
  1236.        03/21/95 10:00  6.02e23
  1237.  
  1238.  This file can be plotted by
  1239.  
  1240.        set xdata time
  1241.        set timefmt "%m/%d/%y"
  1242.        set xrange ["03/21/95":"03/22/95"]
  1243.        set format x "%m/%d"
  1244.        set timefmt "%m/%d/%y %H:%M"
  1245.        plot "data" using 1:3
  1246.  
  1247.  which will produce xtic labels that look like "03/21".
  1248.  
  1249.  See the descriptions of each command for more details.
  1250.  
  1251. 
  1252. File: gnuplot.info, Node: Commands, Prev: gnuplot, Up: Top, Next: cd
  1253.  
  1254.  This section lists the commands acceptable to `gnuplot` (*note gnuplot:: ) in
  1255.  alphabetical order.  Printed versions of this document contain all commands;
  1256.  on-line versions may not be complete.  Indeed, on some systems there may be
  1257.  no commands at all listed under this heading.
  1258.  
  1259.  Note that in most cases unambiguous abbreviations for command names and their
  1260.  options are permissible, i.e., "`p f(x) w l`" instead of "`plot f(x) with
  1261.  lines`".
  1262.  
  1263.  In the syntax descriptions, braces ({}) denote optional arguments and a
  1264.  vertical bar (|) separates mutually exclusive choices.
  1265.  
  1266. * Menu:
  1267.  
  1268. * cd::
  1269. * call::
  1270. * clear::
  1271. * exit::
  1272. * fit::
  1273. * help::
  1274. * if::
  1275. * load::
  1276. * pause::
  1277. * plot::
  1278. * print::
  1279. * pwd::
  1280. * quit::
  1281. * replot::
  1282. * reread::
  1283. * reset::
  1284. * save::
  1285. * set-show::
  1286. * shell::
  1287. * splot::
  1288. * test::
  1289. * update::
  1290.  
  1291. 
  1292. File: gnuplot.info, Node: cd, Prev: Commands, Up: Commands, Next: call
  1293.  
  1294.  The `cd` command changes the working directory.
  1295.  
  1296.  Syntax:
  1297.        cd '<directory-name>'
  1298.  
  1299.  The directory name must be enclosed in quotes.
  1300.  
  1301.  Examples:
  1302.        cd 'subdir'
  1303.        cd ".."
  1304.  
  1305.  DOS users _must_ use single-quotes---backslash [\] has special significance
  1306.  inside double-quotes.  For example,
  1307.        cd "c:\newdata"
  1308.  fails, but
  1309.        cd 'c:\newdata'
  1310.  works as expected.
  1311.  
  1312. 
  1313. File: gnuplot.info, Node: call, Prev: cd, Up: Commands, Next: clear
  1314.  
  1315.  The `call` command is identical to the load command with one exception: you
  1316.  can have up to ten additional parameters to the command (delimited according
  1317.  to the standard parser rules) which can be substituted into the lines read
  1318.  from the file.  As each line is read from the `call`ed input file, it is
  1319.  scanned for the sequence `$` (dollar-sign) followed by a digit (0--9).  If
  1320.  found, the sequence is replaced by the corresponding parameter from the
  1321.  `call` command line.  If the parameter was specified as a string in the
  1322.  `call` line, it is substituted without its enclosing quotes.  `$` followed by
  1323.  any character other than a digit will be that character.  E.g. use `$$` to
  1324.  get a single `$`.  Providing more than ten parameters on the `call` command
  1325.  line will cause an error.  A parameter that was not provided substitutes as
  1326.  nothing.  Files being `call`ed may themselves contain `call` or `load`
  1327.  (*note load:: ) commands.
  1328.  
  1329.  The `call` command _must_ be the last command on a multi-command line.
  1330.  
  1331.  Syntax:
  1332.        call "<input-file>" <parameter-0> <parm-1> ... <parm-9>
  1333.  
  1334.  The name of the input file must be enclosed in quotes, and it is recommended
  1335.  that parameters are similarly enclosed in quotes (future versions of gnuplot
  1336.  may treat quoted and unquoted arguments differently).
  1337.  
  1338.  Example:
  1339.  
  1340.  If the file 'calltest.gp' contains the line:
  1341.        print "p0=$0 p1=$1 p2=$2 p3=$3 p4=$4 p5=$5 p6=$6 p7=x$7x"
  1342.  
  1343.  entering the command:
  1344.        call 'calltest.gp' "abcd" 1.2 + "'quoted'" -- "$2"
  1345.  
  1346.  will display:
  1347.        p0=abcd p1=1.2 p2=+ p3='quoted' p4=- p5=- p6=$2 p7=xx
  1348.  
  1349.  NOTE: there is a clash in syntax with the datafile `using` (*note using:: )
  1350.  callback operator.  Use `$$n` or `column(n)` to access column n from a
  1351.  datafile inside a `call`ed datafile plot.
  1352.  
  1353.  
  1354. 
  1355. File: gnuplot.info, Node: clear, Prev: call, Up: Commands, Next: exit
  1356.  
  1357.  The `clear` command erases the current screen or output device as specified
  1358.  by `set output` (*note output:: ).  This usually generates a formfeed on
  1359.  hardcopy devices.  Use `set terminal` (*note terminal:: ) to set the device
  1360.  type.
  1361.  
  1362.  For some terminals `clear` erases only the portion of the plotting surface
  1363.  defined by `set size` (*note size:: ), so for these it can be used in
  1364.  conjunction with set multiplot` to create an inset.
  1365.  
  1366.  Example:
  1367.        set multiplot
  1368.        plot sin(x)
  1369.        set origin 0.5,0.5
  1370.        set size 0.4,0.4
  1371.        clear
  1372.        plot cos(x)
  1373.        set nomultiplot
  1374.  
  1375.  Please see `set multiplot` (*note multiplot:: ), set size, and nd `set origin`
  1376.  (*note origin:: ) for details of these commands.
  1377.  
  1378.  
  1379. 
  1380. File: gnuplot.info, Node: exit, Prev: clear, Up: Commands, Next: fit
  1381.  
  1382.  The commands `exit` and `quit` (*note quit:: ) and the END-OF-FILE character
  1383.  will exit the current `gnuplot` (*note gnuplot:: ) command file and  `load`
  1384.  (*note load:: ) the next one.  See "help batch/interactive" for more details.
  1385.  
  1386.  Each of these commands will clear the output device (as does the `clear`
  1387.  (*note clear:: ) command) before exiting.
  1388.  
  1389.  
  1390. 
  1391. File: gnuplot.info, Node: fit, Prev: exit, Up: Commands, Next: adjustable parameters
  1392.  
  1393.  The `fit` command can fit a user-defined function to a set of data points
  1394.  (x,y) or (x,y,z), using an implementation of the nonlinear least-squares
  1395.  (NLLS) Marquardt-Levenberg algorithm.  Any user-defined variable occurring in
  1396.  the function body may serve as a fit parameter, but the return type of the
  1397.  function must be real.
  1398.  
  1399.  Syntax:
  1400.        fit {[xrange] {[yrange]}} <function> '<datafile>'
  1401.            {datafile-modifiers}
  1402.            via '<parameter file>' | <var1>{,<var2>,...}
  1403.  
  1404.  Ranges may be specified to temporarily limit the data which is to be fitted;
  1405.  any out-of-range data points are ignored. The syntax is
  1406.        [{dummy_variable=}{<min>}{:<max>}],
  1407.  analogous to `plot` (*note plot:: ); see  `plot ranges` (*note ranges:: ).
  1408.  
  1409.  <function> is any valid `gnuplot` (*note gnuplot:: ) expression, although it
  1410.  is usual to use a previously user-defined function of the form f(x) or
  1411.  f(x,y).
  1412.  
  1413.  <datafile> is treated as in the `plot` command.  All the `plot datafile`
  1414.  (*note data-file:: ) modifiers (`using` (*note using:: ),  `every`
  1415.  (*note every:: ),...) except  `smooth` (*note smooth:: ) are applicable to
  1416.  fit. See `plot datafile`.
  1417.  
  1418.  The default data formats for fitting functions with a single independent
  1419.  variable, y=f(x), are {x:}y or x:y:s; those formats can be changed with
  1420.  the datafile `using` qualifier.  The third item, (a column number or an
  1421.  expression), if present, is interpreted as the standard deviation of the
  1422.  corresponding y value and is used to compute a weight for the datum, 1/s**2.
  1423.  Otherwise, all data points are weighted equally, with a weight of one.
  1424.  
  1425.  To fit a function with two independent variables, z=f(x,y), the required
  1426.  format is `using` with four items, x:y:z:s.  The complete format must be
  1427.  given---no default columns are assumed for a missing token.  Weights for
  1428.  each data point are evaluated from 's' as above.  If error estimates are
  1429.  not available, a constant value can be specified as a constant expression
  1430.  (see `plot datafile using`), e.g., `using 1:2:3:(1)`.
  1431.  
  1432.  Multiple datasets may be simultaneously fit with functions of one
  1433.  independent variable by making y a 'pseudo-variable', e.g., the dataline
  1434.  number, and fitting as two independent variables.  See `fit multibranch`.
  1435.  
  1436.  The `via` qualifier specifies which parameters are to be adjusted, either
  1437.  directly, or by referencing a parameter file.
  1438.  
  1439.  Examples:
  1440.        f(x) = a*x**2 + b*x + c
  1441.        g(x,y) = a*x**2 + b*y**2 + c*x*y
  1442.        FIT_LIMIT = 1e-6
  1443.        fit f(x) 'measured.dat' via 'start.par'
  1444.        fit f(x) 'measured.dat' using 3:($7-5) via 'start.par'
  1445.        fit f(x) './data/trash.dat' using 1:2:3 via a, b, c
  1446.        fit g(x,y) 'surface.dat' using 1:2:3:(1) via a, b, c
  1447.  
  1448.  After each iteration step, detailed information about the current state
  1449.  of the fit is written to the display.  The same information about the
  1450.  initial and final states is written to a log file, "fit.log".  This file
  1451.  is always appended to, so as to not lose any previous fit history;  it
  1452.  should be deleted or renamed as desired.
  1453.  
  1454.  The fit may be interrupted by pressing Ctrl-C (any key but Ctrl-C under
  1455.  MSDOS and Atari Multitasking Systems).  After the current iteration
  1456.  completes, you have the option to (1) stop the fit and accept the current
  1457.  parameter values, (2) continue the fit, (3) execute a `gnuplot` command
  1458.  as specified by the environment variable FIT_SCRIPT.  The default for
  1459.  FIT_SCRIPT is `replot` (*note replot:: ), so if you had previously plotted
  1460.  both the data and the fitting function in one graph, you can display the
  1461.  current state of the fit.
  1462.  
  1463.  Once `fit` has finished, the `update` (*note update:: ) command may be used to
  1464.  store final values in a file for subsequent use as a parameter file.   See
  1465.  `update` for details.
  1466.  
  1467.  
  1468. * Menu:
  1469.  
  1470. * adjustable parameters::
  1471. * beginner's guide::
  1472. * error estimates::
  1473. * fit controlling::
  1474. * multi-branch::
  1475. * starting values::
  1476. * tips::
  1477.  
  1478. 
  1479. File: gnuplot.info, Node: adjustable parameters, Prev: fit, Up: fit, Next: beginner's guide
  1480.  
  1481.  There are two ways that `via` can specify the parameters to be adjusted,
  1482.  either directly on the command line or indirectly, by referencing a
  1483.  parameter file.  The two use different means to set initial values.
  1484.  
  1485.  Adjustable parameters can be specified by a comma-separated list of variable
  1486.  names after the `via` keyword.  Any variable that is not already defined is
  1487.  is created with an initial value of 1.0.  However, the fit is more likely
  1488.  to converge rapidly if the variables have been previously declared with more
  1489.  appropriate starting values.
  1490.  
  1491.  In a parameter file, each parameter to be varied and a corresponding initial
  1492.  value are specified, one per line, in the form
  1493.        varname = value
  1494.  
  1495.  Comments, marked by '#', and blank lines are permissible.  The
  1496.  special form
  1497.        varname = value       # FIXED
  1498.  
  1499.  means that the variable is treated as a 'fixed parameter', initialized by the
  1500.  parameter file, but not adjusted by `fit` (*note fit:: ).  For clarity, it may
  1501.  be useful to designate variables as fixed parameters so that their values are
  1502.  reported by `fit`.  The keyword `# FIXED` has to appear in exactly this form.
  1503.  
  1504.  
  1505. 
  1506. File: gnuplot.info, Node: beginner's guide, Prev: adjustable parameters, Up: fit, Next: error estimates
  1507.  
  1508.  `fit` (*note fit:: ) is used to find a set of parameters that 'best' fits your
  1509.  data to your user-defined function.  The fit is judged on the basis of the the
  1510.  sum of the squared differences or 'residuals' (SSR) between the input data
  1511.  points and the function values, evaluated at the same places.  This quantity
  1512.  is often called 'chisquare' (i.e., the Greek letter chi, to the power of
  1513.  2).  The algorithm attempts to minimize SSR, or more precisely, WSSR, as the
  1514.  residuals are 'weighted' by the input data errors (or 1.0) before being
  1515.  squared; see `fit error_estimates` for details.
  1516.  
  1517.  That's why it is called 'least-squares fitting'.  Let's look at an example
  1518.  to see what is meant by 'non-linear', but first we had better go over some
  1519.  terms.  Here it is convenient to use z as the dependent variable for
  1520.  user-defined functions of either one independent variable, z=f(x), or two
  1521.  independent variables, z=f(x,y).  A parameter is a user-defined variable
  1522.  that `fit` will adjust, i.e., an unknown quantity in the function
  1523.  declaration.  Linearity/non-linearity refers to the relationship of the
  1524.  dependent variable, z, to the parameters which `fit` is adjusting, not of
  1525.  z to the independent variables, x and/or y.  (To be technical, the
  1526.  second {and higher} derivatives of the fitting function with respect to
  1527.  the parameters are zero for a linear least-squares problem).
  1528.  
  1529.  For linear least-squares (LLS), the user-defined function will be a sum of
  1530.  simple functions, not involving any parameters, each multiplied by one
  1531.  parameter.  NLLS handles more complicated functions in which parameters can
  1532.  be used in a large number of ways.  An example that illustrates the
  1533.  difference between linear and nonlinear least-squares is the Fourier series.
  1534.  One member may be written as
  1535.       z=a*sin(c*x) + b*cos(c*x).
  1536.  If a and b are the unknown parameters and c is constant, then estimating
  1537.  values of the parameters is a linear least-squares problem.  However, if
  1538.  c is an unknown parameter, the problem is nonlinear.
  1539.  
  1540.  In the linear case, parameter values can be determined by comparatively
  1541.  simple linear algebra, in one direct step.  However LLS is a special case
  1542.  which is also solved along with more general NLLS problems by the iterative
  1543.  procedure that `gnuplot` (*note gnuplot:: ) uses.  fit attempts to find the
  1544.  minimum by doing a search.  Each step (iteration) calculates WSSR with a new
  1545.  set of parameter values.  The Marquardt-Levenberg algorithm selects the
  1546.  parameter values for the next iteration.  The process continues until a preset
  1547.  criterium is met, either (1) the fit has "converged" (the relative change in
  1548.  WSSR is less than FIT_LIMIT), or (2) it reaches a preset iteration count
  1549.  limit, FIT_MAXITER (see `fit control variables`
  1550.  (*note control variables:: )).  The fit may also be interrupted and
  1551.  subsequently halted from the keyboard (see `fit`).
  1552.  
  1553.  Often the function to be fitted will be based on a model (or theory) that
  1554.  attempts to describe or predict the behaviour of the data.  Then `fit` can
  1555.  be used to find values for the free parameters of the model, to determine
  1556.  how well the data fits the model, and to estimate an error range for each
  1557.  parameter.  See `fit error_estimates`.
  1558.  
  1559.  Alternatively, in curve-fitting, functions are selected independent of
  1560.  a model (on the basis of experience as to which are likely to describe
  1561.  the trend of the data with the desired resolution and a minimum number
  1562.  of parameters*functions.)  The `fit` solution then provides an analytic
  1563.  representation of the curve.
  1564.  
  1565.  However, if all you really want is a smooth curve through your data points,
  1566.  the `smooth` (*note smooth:: ) option to  `plot` (*note plot:: ) may be what
  1567.  you've been looking for rather than `fit`.
  1568.  
  1569.  
  1570. 
  1571. File: gnuplot.info, Node: error estimates, Prev: beginner's guide, Up: fit, Next: statistical overview
  1572.  
  1573.  In `fit` (*note fit:: ), the term "error" is used in two different contexts,
  1574.  data error estimates and parameter error estimates.
  1575.  
  1576.  Data error estimates are used to calculate the relative weight of each data
  1577.  point when determining the weighted sum of squared residuals, WSSR or
  1578.  chisquare.  They can affect the parameter estimates, since they determine
  1579.  how much influence the deviation of each data point from the fitted function
  1580.  has on the final values.  Some of the `fit` output information, including
  1581.  the parameter error estimates, is more meaningful if accurate data error
  1582.  estimates have been provided.
  1583.  
  1584.  The 'statistical overview' describes some of the `fit` output and gives some
  1585.  background for the 'practical guidelines'.
  1586.  
  1587. * Menu:
  1588.  
  1589. * statistical overview::
  1590. * practical guidelines::
  1591.  
  1592. 
  1593. File: gnuplot.info, Node: statistical overview, Prev: error estimates, Up: error estimates, Next: practical guidelines
  1594.  
  1595.  The theory of non-linear least-squares (NLLS) is generally described in terms
  1596.  of a normal distribution of errors, that is, the input data is assumed to be
  1597.  a sample from a population having a given mean and a Gaussian (normal)
  1598.  distribution about the mean with a given standard deviation.  For a sample of
  1599.  sufficiently large size, and knowing the population standard deviation, one
  1600.  can use the statistics of the chisquare distribution to describe a "goodness
  1601.  of fit" by looking at the variable often called "chisquare".  Here, it is
  1602.  sufficient to say that a reduced chisquare (chisquare/degrees of freedom,
  1603.  where degrees of freedom is the number of datapoints less the number of
  1604.  parameters being fitted) of 1.0 is an indication that the weighted sum of
  1605.  squared deviations between the fitted function and the data points is the
  1606.  same as that expected for a random sample from a population characterized by
  1607.  the function with the current value of the parameters and the given standard
  1608.  deviations.
  1609.  
  1610.  If the standard deviation for the population is not constant, as in counting
  1611.  statistics where variance = counts, then each point should be individually
  1612.  weighted when comparing the observed sum of deviations and the expected sum
  1613.  of deviations.
  1614.  
  1615.  At the conclusion `fit` (*note fit:: ) reports 'stdfit', the standard
  1616.  deviation of the fit, which is the rms of the residuals, and the variance of
  1617.  the residuals, also called 'reduced chisquare' when the data points are
  1618.  weighted.  The number of degrees of freedom (the number of data points minus
  1619.  the number of fitted parameters) is used in these estimates because the
  1620.  parameters used in calculating the residuals of the datapoints were obtained
  1621.  from the same data.
  1622.  
  1623.  To estimate confidence levels for the parameters, one can use the minimum
  1624.  chisquare obtained from the fit and chisquare statistics to determine the
  1625.  value of chisquare corresponding to the desired confidence level, but
  1626.  considerably more calculation is required to determine the combinations of
  1627.  parameters which produce such values.
  1628.  
  1629.  Rather than determine confidence intervals, `fit` reports parameter error
  1630.  estimates which are readily obtained from the variance-covariance matrix
  1631.  after the final iteration.  By convention, these estimates are called
  1632.  "standard errors" or "asymptotic standard errors", since they are calculated
  1633.  in the same way as the standard errors (standard deviation of each parameter)
  1634.  of a linear least-squares problem, even though the statistical conditions for
  1635.  designating the quantity calculated to be a standard deviation are not
  1636.  generally valid for the NLLS problem.  The asymptotic standard errors are
  1637.  generally over-optimistic and should not be used for determining confidence
  1638.  levels, but are useful for qualitative purposes.
  1639.  
  1640.  The final solution also produces a correlation matrix, which gives an
  1641.  indication of the correlation of parameters in the region of the solution;
  1642.  if one parameter is changed, increasing chisquare, does changing another
  1643.  compensate?  The main diagonal elements, autocorrelation, are all 1; if
  1644.  all parameters were independent, all other elements would be nearly 0.  Two
  1645.  variables which completely compensate each other would have an off-diagonal
  1646.  element of unit magnitude, with a sign depending on whether the relation is
  1647.  proportional or inversely proportional.  The smaller the magnitudes of the
  1648.  off-diagonal elements, the closer the estimates of the standard deviation
  1649.  of each parameter would be to the asymptotic standard error.
  1650.  
  1651. 
  1652. File: gnuplot.info, Node: practical guidelines, Prev: statistical overview, Up: error estimates
  1653.  
  1654.  If you have a basis for assigning weights to each data point, doing so lets
  1655.  you make use of additional knowledge about your measurements, e.g., take into
  1656.  account that some points may be more reliable than others.  That may affect
  1657.  the final values of the parameters.
  1658.  
  1659.  Weighting the data provides a basis for interpreting the additional `fit`
  1660.  (*note fit:: ) output after the last iteration.  Even if you weight each point
  1661.  equally, estimating an average standard deviation rather than using a weight
  1662.  of 1 makes WSSR a dimensionless variable, as chisquare is by definition.
  1663.  
  1664.  Each fit iteration will display information which can be used to evaluate
  1665.  the progress of the fit.  (An '*' indicates that it did not find a smaller
  1666.  WSSR and is trying again.)  The 'sum of squares of residuals', also called
  1667.  'chisquare', is the WSSR between the data and your fitted function; `fit`
  1668.  has minimized that.  At this stage, with weighted data, chisquare is expected
  1669.  to approach the number of degrees of freedom (data points minus parameters).
  1670.  The WSSR can be used to calculate the reduced chisquare (WSSR/ndf) or stdfit,
  1671.  the standard deviation of the fit, sqrt(WSSR/ndf).  Both of these are
  1672.  reported for the final WSSR.
  1673.  
  1674.  If the data are unweighted, stdfit is the rms value of the deviation of the
  1675.  data from the fitted function, in user units.
  1676.  
  1677.  If you supplied valid data errors, the number of data points is large enough,
  1678.  and the model is correct, the reduced chisquare should be about unity.  (For
  1679.  details, look up the 'chi-squared distribution' in your favourite statistics
  1680.  reference.)  If so, there are additional tests, beyond the scope of this
  1681.  overview, for determining how well the model fits the data.
  1682.  
  1683.  A reduced chisquare much larger than 1.0 may be due to incorrect data error
  1684.  estimates, data errors not normally distributed, systematic measurement
  1685.  errors, 'outliers', or an incorrect model function.  A plot of the residuals,
  1686.  e.g., `plot 'datafile' using 1:($2-f($1))`, may help to show any systematic
  1687.  trends.  Plotting both the data points and the function may help to suggest
  1688.  another model.
  1689.  
  1690.  Similarly, a reduced chisquare less than 1.0 indicates WSSR is less than that
  1691.  expected for a random sample from the function with normally distributed
  1692.  errors.  The data error estimates may be too large, the statistical
  1693.  assumptions may not be justified, or the model function may be too general,
  1694.  fitting fluctuations in a particular sample in addition to the underlying
  1695.  trends.  In the latter case, a simpler function may be more appropriate.
  1696.  
  1697.  You'll have to get used to both `fit` and the kind of problems you apply it
  1698.  to before you can relate the standard errors to some more practical estimates
  1699.  of parameter uncertainties or evaluate the significance of the correlation
  1700.  matrix.
  1701.  
  1702.  Note that `fit`, in common with most NLLS implementations, minimizes the
  1703.  weighted sum of squared distances (y-f(x))**2.  It does not provide any means
  1704.  to account for "errors" in the values of x, only in y.  Also, any "outliers"
  1705.  (data points outside the normal distribution of the model) will have an
  1706.  exaggerated effect on the solution.
  1707.  
  1708. 
  1709. File: gnuplot.info, Node: fit controlling, Prev: error estimates, Up: fit, Next: control variables
  1710.  
  1711.  There are a number of `gnuplot` (*note gnuplot:: ) variables that can be
  1712.  defined to affect `fit` (*note fit:: ).  Those which can be defined once
  1713.  gnuplot is running are listed under 'control_variables' while those defined
  1714.  before starting `gnuplot` are listed under 'environment_variables'.
  1715.  
  1716.  
  1717. * Menu:
  1718.  
  1719. * control variables::
  1720. * environment variables::
  1721.  
  1722. 
  1723. File: gnuplot.info, Node: control variables, Prev: fit controlling, Up: fit controlling, Next: environment variables
  1724.  
  1725.  The default epsilon limit (1e-5) may be changed by declaring a value for
  1726.        FIT_LIMIT
  1727.  When the sum of squared residuals changes between two iteration steps by
  1728.  a factor less than this number (epsilon), the fit is considered to have
  1729.  'converged'.
  1730.  
  1731.  The maximum number of iterations may be limited by declaring a value for
  1732.        FIT_MAXITER
  1733.  A value of 0 (or not defining it at all)  means that there is no limit.
  1734.  
  1735.  If you need even more control about the algorithm, and know the
  1736.  Marquardt-Levenberg algorithm well, there are some more variables to
  1737.  influence it. The startup value of `lambda` is normally calculated
  1738.  automatically from the ML-matrix, but if you want to, you may provide
  1739.  your own one with
  1740.        FIT_START_LAMBDA
  1741.  Specifying FIT_START_LAMBDA as zero or less will re-enable the automatic
  1742.  selection. The variable
  1743.        FIT_LAMBDA_FACTOR
  1744.  gives the factor by which `lambda` is increased or decreased whenever
  1745.  the chi-squared target function increased or decreased significantly.
  1746.  Setting FIT_LAMBDA_FACTOR to zero re-enables the default factor of
  1747.  10.0.
  1748.  
  1749.  Oher variables with the FIT_ prefix may be added to `fit` (*note fit:: ), so
  1750.  it is safer not to use that prefix for user-defined variables.
  1751.  
  1752.  The variables FIT_SKIP and FIT_INDEX were used by earlier releases of
  1753.  `gnuplot` (*note gnuplot:: ) with a 'fit' patch called gnufit and are no
  1754.  longer available. The datafile `every` (*note every:: ) modifier provides the
  1755.  functionality of FIT_SKIP. FIT_INDEX was used for multi-branch fitting, but
  1756.  multi-branch fitting of one independent variable is now done as a pseudo-3D
  1757.  fit in which the second independent variable and `using` (*note using:: ) are
  1758.  used to specify the branch. See `fit multi-branch` (*note multi-branch:: ).
  1759.  
  1760.  
  1761. 
  1762. File: gnuplot.info, Node: environment variables, Prev: control variables, Up: fit controlling
  1763.  
  1764.  The environment variables must be defined before `gnuplot` (*note gnuplot:: )
  1765.  is executed; how to do so depends on your operating system.
  1766.  
  1767.        FIT_LOG
  1768.  changes the name (and/or path) of the file to which the fit log will be
  1769.  written from the default of "fit.log" in the working directory.
  1770.  
  1771.        FIT_SCRIPT
  1772.  specifies a command that may be executed after an user interrupt. The default
  1773.  is `replot` (*note replot:: ), but a  `plot` (*note plot:: ) or  `load`
  1774.  (*note load:: ) command may be useful to display a plot customized to
  1775.  highlight the progress of the fit.
  1776.  
  1777.  
  1778. 
  1779. File: gnuplot.info, Node: multi-branch, Prev: fit controlling, Up: fit, Next: starting values
  1780.  
  1781.  In multi-branch fitting, multiple data sets can be simultaneously fit with
  1782.  functions of one independent variable having common parameters by minimizing
  1783.  the total WSSR.  The function and parameters (branch) for each data set are
  1784.  selected by using a 'pseudo-variable', e.g., either the dataline number (a
  1785.  'column' index of -1) or the datafile index (-2), as the second independent
  1786.  variable.
  1787.  
  1788.  Example:  Given two exponential decays of the form, z=f(x), each describing
  1789.  a different data set but having a common decay time, estimate the values of
  1790.  the parameters.  If the datafile has the format x:z:s, then
  1791.       f(x,y) = (y==0) ? a*exp(-x/tau) : b*exp(-x/tau)
  1792.       fit f(x,y) 'datafile' using  1:-1:2:3  via a, b, tau
  1793.  
  1794.  For a more complicated example, see the file "hexa.fnc" used by the
  1795.  "fit.dem" demo.
  1796.  
  1797.  Appropriate weighting may be required since unit weights may cause one
  1798.  branch to predominate if there is a difference in the scale of the dependent
  1799.  variable.  Fitting each branch separately, using the multi-branch solution
  1800.  as initial values, may give an indication as to the relative effect of each
  1801.  branch on the joint solution.
  1802.  
  1803. 
  1804. File: gnuplot.info, Node: starting values, Prev: multi-branch, Up: fit, Next: tips
  1805.  
  1806.  Nonlinear fitting is not guaranteed to converge to the global optimum (the
  1807.  solution with the smallest sum of squared residuals, SSR), and can get stuck
  1808.  at a local minimum.  The routine has no way to determine that;  it is up to
  1809.  you to judge whether this has happened.
  1810.  
  1811.  `fit` (*note fit:: ) may, and often will get "lost" if started far from a
  1812.  solution, where SSR is large and changing slowly as the parameters are varied,
  1813.  or it may reach a numerically unstable region (e.g., too large a number
  1814.  causing a floating point overflow) which results in an "undefined value"
  1815.  message or `gnuplot` (*note gnuplot:: ) halting.
  1816.  
  1817.  To improve the chances of finding the global optimum, you should set the
  1818.  starting values at least roughly in the vicinity of the solution, e.g.,
  1819.  within an order of magnitude, if possible.  The closer your starting values
  1820.  are to the solution, the less chance of stopping at another minimum.  One way
  1821.  to find starting values is to plot data and the fitting function on the same
  1822.  graph and change parameter values and `replot` (*note replot:: ) until
  1823.  reasonable similarity is reached.  The same plot is also useful to check
  1824.  whether the fit stopped at a minimum with a poor fit.
  1825.  
  1826.  Of course, a reasonably good fit is not proof there is not a "better" fit (in
  1827.  either a statistical sense, characterized by an improved goodness-of-fit
  1828.  criterion, or a physical sense, with a solution more consistent with the
  1829.  model.)  Depending on the problem, it may be desirable to `fit` with various
  1830.  sets of starting values, covering a reasonable range for each parameter.
  1831.  
  1832. 
  1833. File: gnuplot.info, Node: tips, Prev: starting values, Up: fit
  1834.  
  1835.  Here are some tips to keep in mind to get the most out of `fit`
  1836.  (*note fit:: ).  They're not very organized, so you'll have to read them
  1837.  several times until their essence has sunk in.
  1838.  
  1839.  The two forms of the `via` argument to `fit` serve two largely distinct
  1840.  purposes.  The `via "file"` form is best used for (possibly unattended) batch
  1841.  operation, where you just supply the startup values in a file and can later
  1842.  use `update` (*note update:: ) to copy the results back into another (or the
  1843.  same) parameter file.
  1844.  
  1845.  The `via var1, var2, ...` form is best used interactively, where the command
  1846.  history mechanism may be used to edit the list of parameters to be fitted or
  1847.  to supply new startup values for the next try.  This is particularly useful
  1848.  for hard problems, where a direct fit to all parameters at once won't work
  1849.  without good starting values.  To find such, you can iterate several times,
  1850.  fitting only some of the parameters, until the values are close enough to the
  1851.  goal that the final fit to all parameters at once will work.
  1852.  
  1853.  Make sure that there is no mutual dependency among parameters of the function
  1854.  you are fitting.  For example, don't try to fit a*exp(x+b), because
  1855.  a*exp(x+b)=a*exp(b)*exp(x).  Instead, fit either a*exp(x) or exp(x+b).
  1856.  
  1857.  A technical issue:  the parameters must not be too different in magnitude.
  1858.  The larger the ratio of the largest and the smallest absolute parameter
  1859.  values, the slower the fit will converge.  If the ratio is close to or above
  1860.  the inverse of the machine floating point precision, it may take next to
  1861.  forever to converge, or refuse to converge at all.  You will have to adapt
  1862.  your function to avoid this, e.g., replace 'parameter' by '1e9*parameter' in
  1863.  the function definition, and divide the starting value by 1e9.
  1864.  
  1865.  If you can write your function as a linear combination of simple functions
  1866.  weighted by the parameters to be fitted, by all means do so.  That helps a
  1867.  lot, because the problem is no longer nonlinear and should converge with only
  1868.  a small number of iterations, perhaps just one.
  1869.  
  1870.  Some prescriptions for analysing data, given in practical experimentation
  1871.  courses, may have you first fit some functions to your data, perhaps in a
  1872.  multi-step process of accounting for several aspects of the underlying
  1873.  theory one by one, and then extract the information you really wanted from
  1874.  the fitting parameters of those functions.  With `fit`, this may often be
  1875.  done in one step by writing the model function directly in terms of the
  1876.  desired parameters.  Transforming data can also quite often be avoided,
  1877.  though sometimes at the cost of a more difficult fit problem.  If you think
  1878.  this contradicts the previous paragraph about simplifying the fit function,
  1879.  you are correct.
  1880.  
  1881.  A "singular matrix" message indicates that this implementation of the
  1882.  Marquardt-Levenberg algorithm can't calculate parameter values for the next
  1883.  iteration.  Try different starting values, writing the function in another
  1884.  form, or a simpler function.
  1885.  
  1886.  Finally, a nice quote from the manual of another fitting package (fudgit),
  1887.  that kind of summarizes all these issues:  "Nonlinear fitting is an art!"
  1888.  
  1889. 
  1890. File: gnuplot.info, Node: help, Prev: fit, Up: Commands, Next: if
  1891.  
  1892.  The `help` command displays on-line help. To specify information on a
  1893.  particular topic use the syntax:
  1894.  
  1895.        help {<topic>}
  1896.  
  1897.  If <topic> is not specified, a short message is printed about `gnuplot`
  1898.  (*note gnuplot:: ). After help for the requested topic is given, a menu of
  1899.  subtopics is given; help for a subtopic may be requested by typing its name,
  1900.  extending the help request.  After that subtopic has been printed, the request
  1901.  may be extended again or you may go back one level to the previous
  1902.  topic.  Eventually, the `gnuplot` command line will return.
  1903.  
  1904.  If a question mark (?) is given as the topic, the list of topics currently
  1905.  available is printed on the screen.
  1906.  
  1907. 
  1908. File: gnuplot.info, Node: if, Prev: help, Up: Commands, Next: load
  1909.  
  1910.  The `if` command allows commands to be executed conditionally.
  1911.  
  1912.  Syntax:
  1913.        if (<condition>) <command-line>
  1914.  
  1915.  <condition> will be evaluated.  If it is true (non-zero), then the command(s)
  1916.  of the <command-line> will be executed.  If <condition> is false (zero), then
  1917.  the entire <command-line> is ignored.  Note that use of `;` to allow multiple
  1918.  commands on the same line will _not_ end the conditionalized commands.
  1919.  
  1920.  Examples:
  1921.        pi=3
  1922.        if (pi!=acos(-1)) print "?Fixing pi!"; pi=acos(-1); print pi
  1923.  will display:
  1924.        ?Fixing pi!
  1925.        3.14159265358979
  1926.  but
  1927.        if (1==2) print "Never see this"; print "Or this either"
  1928.  will not display anything.
  1929.  
  1930.  See `reread` (*note reread:: ) for an example of how if and reread can be used
  1931.  together to perform a loop.
  1932.  
  1933.  
  1934. 
  1935. File: gnuplot.info, Node: load, Prev: if, Up: Commands, Next: pause
  1936.  
  1937.  The `load` command executes each line of the specified input file as if it
  1938.  had been typed in interactively.  Files created by the `save` (*note save:: )
  1939.  command can later be `load`ed.  Any text file containing valid commands can be
  1940.  created and then executed by the `load` command.  Files being `load`ed may
  1941.  themselves contain `load` or `call` (*note call:: ) commands.  See comment for
  1942.  information about comments in commands.  To `load` with arguments, see
  1943.  `call`.
  1944.  
  1945.  The `load` command _must_ be the last command on a multi-command line.
  1946.  
  1947.  Syntax:
  1948.        load "<input-file>"
  1949.  
  1950.  The name of the input file must be enclosed in quotes.
  1951.  
  1952.  The special filename "-" may be used to `load` commands from standard input.
  1953.  This allows a `gnuplot` (*note gnuplot:: ) command file to accept some
  1954.  commands from standard input.  Please see "help batch/interactive" for more
  1955.  details.
  1956.  
  1957.  Examples:
  1958.        load 'work.gnu'
  1959.        load "func.dat"
  1960.  
  1961.  The `load` command is performed implicitly on any file names given as
  1962.  arguments to `gnuplot`.  These are loaded in the order specified, and
  1963.  then `gnuplot` exits.
  1964.  
  1965. 
  1966. File: gnuplot.info, Node: pause, Prev: load, Up: Commands, Next: plot
  1967.  
  1968.  The `pause` command displays any text associated with the command and then
  1969.  waits a specified amount of time or until the carriage return is pressed.
  1970.  `pause` is especially useful in conjunction with `load` (*note load:: )
  1971.  files.
  1972.  
  1973.  Syntax:
  1974.        pause <time> {"<string>"}
  1975.  
  1976.  <time> may be any integer constant or expression.  Choosing -1 will wait
  1977.  until a carriage return is hit, zero (0) won't pause at all, and a positive
  1978.  integer will wait the specified number of seconds.  `pause 0` is synonymous
  1979.  with `print` (*note print:: ).
  1980.  
  1981.  Note: Since `pause` communicates with the operating system rather than the
  1982.  graphics, it may behave differently with different device drivers (depending
  1983.  upon how text and graphics are mixed).
  1984.  
  1985.  Examples:
  1986.        pause -1    # Wait until a carriage return is hit
  1987.        pause 3     # Wait three seconds
  1988.        pause -1  "Hit return to continue"
  1989.        pause 10  "Isn't this pretty?  It's a cubic spline."
  1990.  
  1991.  
  1992. 
  1993. File: gnuplot.info, Node: plot, Prev: pause, Up: Commands, Next: data-file
  1994.  
  1995.  `plot` is the primary command for drawing plots with `gnuplot`
  1996.  (*note gnuplot:: ).  It creates plots of functions and data in many, many
  1997.  ways.  `plot` is used to draw 2-d functions and data; `splot` (*note splot:: )
  1998.  draws 2-d projections of 3-d surfaces and data. `plot` and `splot` contain
  1999.  many common features; see `splot` for differences. Note specifically that
  2000.  `splot`'s `binary` (*note binary:: ) and  `matrix` (*note matrix:: ) options
  2001.  do not exist for `plot`.
  2002.  
  2003.  Syntax:
  2004.        plot {<ranges>}
  2005.             {<function> | {"<datafile>" {datafile-modifiers}}}
  2006.             {axes <axes>} {<title-spec>} {with <style>}
  2007.             {, {definitions,} <function> ...}
  2008.  
  2009.  where either a <function> or the name of a data file enclosed in quotes is
  2010.  supplied.  A function is a mathematical expression or a pair of mathematical
  2011.  expressions in parametric mode.  The expressions may be defined completely or
  2012.  in part earlier in the stream of `gnuplot` commands (see `user-defined`
  2013.  (*note User-defined:: )).
  2014.  
  2015.  It is also possible to define functions and parameters on the `plot` command
  2016.  itself.  This is done merely by isolating them from other items with commas.
  2017.  
  2018.  There are four possible sets of axes available; the keyword <axes> is used to
  2019.  select the axes for which a particular line should be scaled.  `x1y1` refers
  2020.  to the axes on the bottom and left; `x2y2` to those on the top and right;
  2021.  `x1y2` to those on the bottom and right; and `x2y1` to those on the top and
  2022.  left.  Ranges specified on the `plot` command apply only to the first set of
  2023.  axes (bottom left).
  2024.  
  2025.  Examples:
  2026.        plot sin(x)
  2027.        plot f(x) = sin(x*a), a = .2, f(x), a = .4, f(x)
  2028.        plot [t=1:10] [-pi:pi*2] tan(t), \
  2029.             "data.1" using (tan($2)):($3/$4) smooth csplines \
  2030.                      axes x1y2 notitle with lines 5
  2031.  
  2032.  
  2033. * Menu:
  2034.  
  2035. * data-file::
  2036. * errorbars::
  2037. * parametric::
  2038. * ranges::
  2039. * title::
  2040. * with::
  2041.  
  2042. 
  2043. File: gnuplot.info, Node: data-file, Prev: plot, Up: plot, Next: every
  2044.  
  2045.  Discrete data contained in a file can be displayed by specifying the name of
  2046.  the data file (enclosed in single or double quotes) on the `plot`
  2047.  (*note plot:: ) command line.
  2048.  
  2049.  Syntax:
  2050.        plot '<file_name>' {index <index list>}
  2051.                              {every <every list>}
  2052.                              {thru <thru expression>}
  2053.                              {using <using list>}
  2054.                              {smooth <option>}
  2055.  
  2056.  The modifiers `index` (*note index:: ),  `every` (*note every:: ),  `thru`
  2057.  (*note thru:: ),  `using` (*note using:: ), and  `smooth` (*note smooth:: )
  2058.  are discussed separately.  In brief, `index` selects which data sets in a
  2059.  multi-data-set file are to be plotted, `every` specifies which points within a
  2060.  single data set are to be plotted, `using` determines how the columns within a
  2061.  single record are to be interpreted (`thru` is a special case of `using`),
  2062.  and `smooth` allows for simple interpolation and approximation.  ('splot' has
  2063.  a similar syntax, but does not support the `smooth` and `thru` options.)
  2064.  
  2065.  Data files should contain at least one data point per record (`using` can
  2066.  select one data point from the record).  Records beginning with `#` (and
  2067.  also with `!` on VMS) will be treated as comments and ignored.  Each data
  2068.  point represents an (x,y) pair.  For `plot`s with error bars (see `set style
  2069.  errorbars`), each data point is (x,y,ydelta), (x,y,ylow,yhigh), (x,y,xdelta),
  2070.  (x,y,xlow,xhigh), or (x,y,xlow,xhigh,ylow,yhigh).  In all cases, the numbers
  2071.  on each record of a data file must be separated by white space (one or more
  2072.  blanks or tabs), unless a format specifier is provided by the `using` option.
  2073.  This white space divides each record into columns.
  2074.  
  2075.  Data may be written in exponential format with the exponent preceded by the
  2076.  letter e, E, d, D, q, or Q.
  2077.  
  2078.  Only one column (the y value) need be provided.  If x is omitted, `gnuplot`
  2079.  (*note gnuplot:: ) provides integer values starting at 0.
  2080.  
  2081.  In datafiles, blank records (records with no characters other than blanks and
  2082.  a newline and/or carriage return) are significant---pairs of blank records
  2083.  separate `index`es (see `plot datafile index`).  Data separated by double
  2084.  blank records are treated as if they were in separate data files.
  2085.  
  2086.  Single blank records designate discontinuities in a `plot`; no line will join
  2087.  points separated by a blank records (if they are plotted with a line style).
  2088.  
  2089.  If autoscaling has been enabled (`set autoscale` (*note autoscale:: )), the
  2090.  axes are automatically extended to include all datapoints, with a whole number
  2091.  of tic marks if tics are being drawn.  This has two consequences: i) For
  2092.  `splot` (*note splot:: ), the corner of the surface may not coincide with the
  2093.  corner of the base.  In this case, no vertical line is drawn.  ii) When
  2094.  plotting data with the same x range on a dual-axis graph, the x coordinates
  2095.  may not coincide if the x2tics are not being drawn.  This is because the x
  2096.  axis has been autoextended to a whole number of tics, but the x2 axis has
  2097.  not.  The following example illustrates the problem:
  2098.  
  2099.        reset; plot '-', '-'
  2100.        1 1
  2101.        19 19
  2102.        e
  2103.        1 1
  2104.        19 19
  2105.        e
  2106.  
  2107. * Menu:
  2108.  
  2109. * every::
  2110. * example datafile::
  2111. * index::
  2112. * smooth::
  2113. * special-filenames::
  2114. * thru::
  2115. * using::
  2116.  
  2117. 
  2118. File: gnuplot.info, Node: every, Prev: data-file, Up: data-file, Next: example datafile
  2119.  
  2120.  The `every` keyword allows a periodic sampling of a data set to be plotted.
  2121.  
  2122.  In the discussion a "point" is a datum defined by a single record in the
  2123.  file; "block" here will mean the same thing as "datablock" (see `glossary`
  2124.  (*note Glossary:: )).
  2125.  
  2126.  Syntax:
  2127.        plot 'file' every {<point_incr>}
  2128.                            {:{<block_incr>}
  2129.                              {:{<start_point>}
  2130.                                {:{<start_block>}
  2131.                                  {:{<end_point>}
  2132.                                    {:<end_block>}}}}}
  2133.  
  2134.  The data points to be plotted are selected according to a loop from
  2135.  <`start_point`> to <`end_point`> with increment <`point_incr`> and the
  2136.  blocks according to a loop from <`start_block`> to <`end_block`> with
  2137.  increment <`block_incr`>.
  2138.  
  2139.  The first datum in each block is numbered '0', as is the first block in the
  2140.  file.
  2141.  
  2142.  Note that records containing unplottable information are counted.
  2143.  
  2144.  Any of the numbers can be omitted; the increments default to unity, the start
  2145.  values to the first point or block, and the end values to the last point or
  2146.  block.  If `every` is not specified, all points in all lines are plotted.
  2147.  
  2148.  Examples:
  2149.        every :::3::3    # selects just the fourth block ('0' is first)
  2150.        every :::::9     # selects the first 10 blocks
  2151.        every 2:2        # selects every other point in every other block
  2152.        every ::5::15    # selects points 5 through 15 in each block
  2153.  
  2154. 
  2155. File: gnuplot.info, Node: example datafile, Prev: every, Up: data-file, Next: index
  2156.  
  2157.  This example plots the data in the file "population.dat" and a theoretical
  2158.  curve:
  2159.  
  2160.        pop(x) = 103*exp((1965-x)/10)
  2161.        plot [1960:1990] 'population.dat', pop(x)
  2162.  
  2163.  The file "population.dat" might contain:
  2164.  
  2165.        # Gnu population in Antarctica since 1965
  2166.           1965   103
  2167.           1970   55
  2168.           1975   34
  2169.           1980   24
  2170.           1985   10
  2171.  
  2172.  
  2173. 
  2174. File: gnuplot.info, Node: index, Prev: example datafile, Up: data-file, Next: smooth
  2175.  
  2176.  The `index` keyword allows only some of the data sets in a multi-data-set
  2177.  file to be plotted.
  2178.  
  2179.  Syntax:
  2180.        plot 'file' index <m>{{:<n>}:<p>}
  2181.  
  2182.  Data sets are separated by pairs of blank records.  `index <m>` selects only
  2183.  set <m>; `index <m>:<n>` selects sets in the range <m> to <n>; and `index
  2184.  <m>:<n>:<p>` selects indices <m>, <m>+<p>, <m>+2<p>, etc., but stopping at
  2185.  <n>.  Following C indexing, the index 0 is assigned to the first data set in
  2186.  the file.  Specifying too large an index results in an error message.  If
  2187.  `index` is not specified, all sets are plotted as a single data set.
  2188.  
  2189.  Example:
  2190.        plot 'file' index 4:5
  2191.  
  2192. 
  2193. File: gnuplot.info, Node: smooth, Prev: index, Up: data-file, Next: acsplines
  2194.  
  2195.  `gnuplot` (*note gnuplot:: ) includes a few general-purpose routines for
  2196.  interpolation and approximation of data; these are grouped under the `smooth`
  2197.  option.  More sophisticated data processing may be performed by preprocessing
  2198.  the data externally or by using `fit` (*note fit:: ) with an appropriate
  2199.  model.
  2200.  
  2201.  Syntax:
  2202.        smooth {unique | csplines | acsplines | bezier | sbezier}
  2203.  
  2204.  `unique` (*note unique:: ) plots the data after making them monotonic.  Each
  2205.  of the other routines uses the data to determine the coefficients of a
  2206.  continuous curve between the endpoints of the data.  This curve is then
  2207.  plotted in the same manner as a function, that is, by finding its value at
  2208.  uniform intervals along the abscissa (see `set samples` (*note samples:: ))
  2209.  and connecting these points with straight line segments (if a line style is
  2210.  chosen).
  2211.  
  2212.  If `autoscale` (*note autoscale:: ) is in effect, the ranges will be computed
  2213.  such that the plotted curve lies within the borders of the graph.
  2214.  
  2215.  If too few points are available to allow the selected option to be applied,
  2216.  an error message is produced.  The minimum number is one for `unique`, four
  2217.  for `acsplines` (*note acsplines:: ), and three for the others.
  2218.  
  2219.  The `smooth` options have no effect on function plots.
  2220.  
  2221. * Menu:
  2222.  
  2223. * acsplines::
  2224. * bezier::
  2225. * csplines::
  2226. * sbezier::
  2227. * unique::
  2228.  
  2229. 
  2230. File: gnuplot.info, Node: acsplines, Prev: smooth, Up: smooth, Next: bezier
  2231.  
  2232.  The `acsplines` option approximates the data with a "natural smoothing spline".
  2233.  After the data are made monotonic in x (see `smooth unique`
  2234.  (*note unique:: )), a curve is piecewise constructed from segments of cubic
  2235.  polynomials whose coefficients are found by the weighting the data points; the
  2236.  weights are taken from the third column in the data file.  That default can be
  2237.  modified by the third entry in the `using` (*note using:: ) list, e.g.,
  2238.        plot 'data-file' using 1:2:(1.0) smooth acsplines
  2239.  
  2240.  Qualitatively, the absolute magnitude of the weights determines the number
  2241.  of segments used to construct the curve.  If the weights are large, the
  2242.  effect of each datum is large and the curve approaches that produced by
  2243.  connecting consecutive points with natural cubic splines.  If the weights are
  2244.  small, the curve is composed of fewer segments and thus is smoother; the
  2245.  limiting case is the single segment produced by a weighted linear least
  2246.  squares fit to all the data.  The smoothing weight can be expressed in terms
  2247.  of errors as a statistical weight for a point divided by a "smoothing factor"
  2248.  for the curve so that (standard) errors in the file can be used as smoothing
  2249.  weights.
  2250.  
  2251.  Example:
  2252.        sw(x,S)=1/(x*x*S)
  2253.        plot 'data_file' using 1:2:(sw($3,100)) smooth acsplines
  2254.  
  2255. 
  2256. File: gnuplot.info, Node: bezier, Prev: acsplines, Up: smooth, Next: csplines
  2257.  
  2258.  The `bezier` option approximates the data with a Bezier curve of degree n
  2259.  (the number of data points) that connects the endpoints.
  2260.  
  2261. 
  2262. File: gnuplot.info, Node: csplines, Prev: bezier, Up: smooth, Next: sbezier
  2263.  
  2264.  The `csplines` option connects consecutive points by natural cubic splines
  2265.  after rendering the data monotonic (see `smooth unique` (*note unique:: )).
  2266.  
  2267.  
  2268. 
  2269. File: gnuplot.info, Node: sbezier, Prev: csplines, Up: smooth, Next: unique
  2270.  
  2271.  The `sbezier` option first renders the data monotonic (`unique`
  2272.  (*note unique:: )) and then applies the `bezier` (*note bezier:: ) algorithm.
  2273.  
  2274.  
  2275. 
  2276. File: gnuplot.info, Node: unique, Prev: sbezier, Up: smooth
  2277.  
  2278.  The `unique` option makes the data monotonic in x; points with the same
  2279.  x-value are replaced by a single point having the average y-value.  The
  2280.  resulting points are then connected by straight line segments.
  2281.  
  2282. 
  2283. File: gnuplot.info, Node: special-filenames, Prev: smooth, Up: data-file, Next: thru
  2284.  
  2285.  A special filename of `'-'` specifies that the data are inline; i.e., they
  2286.  follow the command.  Only the data follow the command; `plot` (*note plot:: )
  2287.  options like filters, titles, and line styles remain on the 'plot' command
  2288.  line.  This is similar to << in unix shell script, and $DECK in VMS DCL.  The
  2289.  data are entered as though they are being read from a file, one data point per
  2290.  record. The letter "e" at the start of the first column terminates data
  2291.  entry.  The `using` (*note using:: ) option can be applied to these
  2292.  data---using it to filter them through a function might make sense, but
  2293.  selecting columns probably doesn't!
  2294.  
  2295.  `'-'` is intended for situations where it is useful to have data and commands
  2296.  together, e.g., when `gnuplot` (*note gnuplot:: ) is run as a sub-process of
  2297.  some front-end application.  Some of the demos, for example, might use this
  2298.  feature.  While `plot` options such as `index` (*note index:: ) and  `every`
  2299.  (*note every:: ) are recognized, their use forces you to enter data that won't
  2300.  be used.  For example, while
  2301.  
  2302.        plot '-' index 0, '-' index 1
  2303.        2
  2304.        4
  2305.        6
  2306.  
  2307.  
  2308.        10
  2309.        12
  2310.        14
  2311.        e
  2312.        2
  2313.        4
  2314.        6
  2315.  
  2316.  
  2317.        10
  2318.        12
  2319.        14
  2320.        e
  2321.  
  2322.  does indeed work,
  2323.  
  2324.        plot '-', '-'
  2325.        2
  2326.        4
  2327.        6
  2328.        e
  2329.        10
  2330.        12
  2331.        14
  2332.        e
  2333.  
  2334.  is a lot easier to type.
  2335.  
  2336.  If you use `'-'` with `replot` (*note replot:: ), you may need to enter the
  2337.  data more than once (see `replot`).
  2338.  
  2339.  A blank filename ('') specifies that the previous filename should be reused.
  2340.  This can be useful with things like
  2341.  
  2342.        plot 'a/very/long/filename' using 1:2, '' using 1:3, '' using 1:4
  2343.  
  2344.  (If you use both `'-'` and `''` on the same `plot` command, you'll need to
  2345.  have two sets of inline data, as in the example above.)
  2346.  
  2347.  On some computer systems with a popen function (Unix), the datafile can be
  2348.  piped through a shell command by starting the file name with a '<'.  For
  2349.  example,
  2350.  
  2351.        pop(x) = 103*exp(-x/10)
  2352.        plot "< awk '{print $1-1965, $2}' population.dat", pop(x)
  2353.  
  2354.  would plot the same information as the first population example but with
  2355.  years since 1965 as the x axis.  If you want to execute this example, you
  2356.  have to delete all comments from the data file above or substitute the
  2357.  following command for the first part of the command above (the part up to
  2358.  the comma):
  2359.  
  2360.        plot "< awk '$0 !~ /^#/ {print $1-1965, $2}' population.dat"
  2361.  
  2362.  While this approach is most flexible, it is possible to achieve simple
  2363.  filtering with the `using` or `thru` (*note thru:: ) keywords.
  2364.  
  2365.  
  2366. 
  2367. File: gnuplot.info, Node: thru, Prev: special-filenames, Up: data-file, Next: using
  2368.  
  2369.  The `thru` function is provided for backward compatibility.
  2370.  
  2371.  Syntax:
  2372.        plot 'file' thru f(x)
  2373.  
  2374.  It is equivalent to:
  2375.  
  2376.        plot 'file' using 1:(f($2))
  2377.  
  2378.  While the latter appears more complex, it is much more flexible.  The more
  2379.  natural
  2380.  
  2381.        plot 'file' thru f(y)
  2382.  
  2383.  also works (i.e. you can use y as the dummy variable).
  2384.  
  2385.  `thru` is parsed for `splot` (*note splot:: ) and  `fit` (*note fit:: ) but
  2386.  has no effect.
  2387.  
  2388.  
  2389. 
  2390. File: gnuplot.info, Node: using, Prev: thru, Up: data-file
  2391.  
  2392.  The most common datafile modifier is `using`.
  2393.  
  2394.  Syntax:
  2395.        plot 'file' using {<entry> {:<entry> {:<entry> ...}}} {'format'}
  2396.  
  2397.  If a format is specified, each datafile record is read using the C library's
  2398.  'scanf' function, with the specified format string.  Otherwise the record is
  2399.  read and broken into columns at spaces or tabs.  A format cannot be specified
  2400.  if time-format data is being used (this must be done by `set data time`).
  2401.  
  2402.  The resulting array of data is then sorted into columns according to the
  2403.  entries.  Each <entry> may be a simple column number, which selects the
  2404.  datum, an expression enclosed in parentheses, or empty.  The expression can
  2405.  use $1 to access the first item read, $2 for the second item, and so on.  It
  2406.  can also use `column(x)` and `valid(x)` where x is an arbitrary expression
  2407.  resulting in an integer.  `column(x)` returns the x'th datum; `valid(x)`
  2408.  tests that the datum in the x'th column is a valid number.  A column number
  2409.  of 0 generates a number increasing (from zero) with each point, and is reset
  2410.  upon encountering two blank records.  A column number of -1 gives the
  2411.  dataline number, which starts at 0, increments at single blank records, and
  2412.  is reset at double blank records.  A column number of -2 gives the index
  2413.  number, which is incremented only when two blank records are found.  An empty
  2414.  <entry> will default to its order in the list of entries.  For example,
  2415.  `using ::4` is interpreted as `using 1:2:4`.
  2416.  
  2417.  N.B.---the `call` (*note call:: ) command also uses $'s as a special
  2418.  character.  See call for details about how to include a column number in a
  2419.  `call` argument list.
  2420.  
  2421.  If the `using` list has but a single entry, that <entry> will be used for y
  2422.  and the data point number is used for x; for example, "`plot 'file' using 1`"
  2423.  is identical to "`plot 'file' using 0:1`".  If the `using` list has two
  2424.  entries, these will be used for x and y.  Additional entries are usually
  2425.  errors in x and/or y.  See `set style` (*note style:: ) for details about
  2426.  plotting styles that make use of error information, and `fit` (*note fit:: )
  2427.  for use of error information in curve fitting.
  2428.  
  2429.  'scanf' accepts several numerical specifications but `gnuplot`
  2430.  (*note gnuplot:: ) requires all inputs to be double-precision floating-point
  2431.  variables, so `lf` is the only permissible specifier.  'scanf' expects to see
  2432.  white space---a blank, tab ("\t"), newline ("\n"), or formfeed
  2433.  ("\f")---between numbers; anything else in the input stream must be explicitly
  2434.  skipped.
  2435.  
  2436.  Note that the use of "\t", "\n", or "\f" or requires use of double-quotes
  2437.  rather than single-quotes.
  2438.  
  2439.  Examples:
  2440.  
  2441.  This creates a plot of the sum of the 2nd and 3rd data against the first:
  2442.  (The format string specifies comma- rather than space-separated columns.)
  2443.        plot 'file' using 1:($2+$3) '%lf,%lf,%lf'
  2444.  
  2445.  In this example the data are read from the file "MyData" using a more
  2446.  complicated format:
  2447.        plot 'MyData' using "%*lf%lf%*20[^\n]%lf"
  2448.  
  2449.  The meaning of this format is:
  2450.  
  2451.        %*lf        ignore a number
  2452.        %lf         read a double-precision number (x by default)
  2453.        %*20[^\n]   ignore 20 non-newline characters
  2454.        %lf         read a double-precision number (y by default)
  2455.  
  2456.  One trick is to use the ternary `?:` operator to filter data:
  2457.  
  2458.        plot 'file' using 1:($3>10 ? $2 : 1/0)
  2459.  
  2460.  which plots the datum in column two against that in column one provided
  2461.  the datum in column three exceeds ten.  `1/0` is undefined; `gnuplot`
  2462.  quietly ignores undefined points, so unsuitable points are suppressed.
  2463.  
  2464.  In fact, you can use a constant expression for the column number, provided it
  2465.  doesn't start with an opening parenthesis; constructs like `using
  2466.  0+(complicated expression)` can be used.  The crucial point is that the
  2467.  expression is evaluated once if it doesn't start with a left parenthesis, or
  2468.  once for each data point read if it does.
  2469.  
  2470.  If timeseries data are being used, the time can span multiple columns.  The
  2471.  starting column should be specified.  Note that the spaces within the time
  2472.  must be included when calculating starting columns for other data.  E.g., if
  2473.  the first element on a line is a time with an embedded space, the y value
  2474.  should be specified as column three.
  2475.  
  2476.  It should be noted that `plot 'file'`, `plot 'file' using 1:2`, and `plot
  2477.  (*note plot:: ) 'file' using ($1):($2)` can be subtly different: 1) if `file`
  2478.  has some lines with one column and some with two, the first will invent x
  2479.  values when they are missing, the second will quietly ignore the lines with
  2480.  one column, and the third will store an undefined value for lines with one
  2481.  point (so that in a plot with lines, no line joins points across the bad
  2482.  point); 2) if a line contains text at the first column, the first will abort
  2483.  the plot on an error, but the second and third should quietly skip the
  2484.  garbage.
  2485.  
  2486.  In fact, it is often possible to plot a file with lots of lines of garbage at
  2487.  the top simply by specifying
  2488.  
  2489.        plot 'file' using 1:2
  2490.  
  2491.  However, if you want to leave text in your data files, it is safer to put the
  2492.  comment character (#) in the first column of the text lines.
  2493.  
  2494. 
  2495. File: gnuplot.info, Node: errorbars, Prev: data-file, Up: plot, Next: parametric
  2496.  
  2497.  Error bars are supported for 2-d data file plots by reading one to four
  2498.  additional columns (or `using` (*note using:: ) entries); these additional
  2499.  values are used in different ways by the various errorbar styles.
  2500.  
  2501.  In the default situation, `gnuplot` (*note gnuplot:: ) expects to see three,
  2502.  four, or six numbers on each line of the data file---either
  2503.  
  2504.        (x, y, ydelta),
  2505.        (x, y, ylow, yhigh),
  2506.        (x, y, xdelta),
  2507.        (x, y, xlow, xhigh),
  2508.        (x, y, xdelta, ydelta), or
  2509.        (x, y, xlow, xhigh, ylow, yhigh).
  2510.  
  2511.  The x coordinate must be specified.  The order of the numbers must be
  2512.  exactly as given above, though the `using` qualifier can manipulate the order
  2513.  and provide values for missing columns.  For example,
  2514.  
  2515.        plot 'file' with errorbars
  2516.        plot 'file' using 1:2:(sqrt($1)) with xerrorbars
  2517.        plot 'file' using 1:2:($1-$3):($1+$3):4:5 with xyerrorbars
  2518.  
  2519.  The last example is for a file containing an unsupported combination of
  2520.  relative x and absolute y errors.  The `using` entry generates absolute x min
  2521.  and max from the relative error.
  2522.  
  2523.  The y error bar is a vertical line plotted from (x, ylow) to (x, yhigh).
  2524.  If ydelta is specified instead of ylow and yhigh, ylow = y - ydelta and
  2525.  yhigh = y + ydelta are derived.  If there are only two numbers on the record,
  2526.  yhigh and ylow are both set to y.  The x error bar is a horizontal line
  2527.  computed in the same fashion.  To get lines plotted between the data points,
  2528.  `plot` (*note plot:: ) the data file twice, once with errorbars and once with
  2529.  lines (but remember to use the `notitle` option on one to avoid two entries in
  2530.  the key).
  2531.  
  2532.  The error bars have crossbars at each end unless `set bar` (*note bar:: ) is
  2533.  used (see set bar` for details).
  2534.  
  2535.  If autoscaling is on, the ranges will be adjusted to include the error bars.
  2536.  
  2537.  See `plot using`, `plot with` (*note with:: ), and  `set style`
  2538.  (*note style:: ) for more information.
  2539.  
  2540.  
  2541. 
  2542. File: gnuplot.info, Node: parametric, Prev: errorbars, Up: plot, Next: ranges
  2543.  
  2544.  When in parametric mode (`set parametric` (*note parametric:: )) mathematical
  2545.  expressions must be given in pairs for `plot` (*note plot:: ) and in triplets
  2546.  for  `splot` (*note splot:: ).
  2547.  
  2548.  Examples:
  2549.        plot sin(t),t**2
  2550.        splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
  2551.  
  2552.  Data files are plotted as before, except any preceding parametric function
  2553.  must be fully specified before a data file is given as a plot.  In other
  2554.  words, the x parametric function (`sin(t)` above) and the y parametric
  2555.  function (`t**2` above) must not be interrupted with any modifiers or data
  2556.  functions; doing so will generate a syntax error stating that the parametric
  2557.  function is not fully specified.
  2558.  
  2559.  Other modifiers, such as `with` (*note with:: ) and  `title` (*note title:: ),
  2560.  may be specified only after the parametric function has been completed:
  2561.  
  2562.        plot sin(t),t**2 title 'Parametric example' with linespoints
  2563.  
  2564. 
  2565. File: gnuplot.info, Node: ranges, Prev: parametric, Up: plot, Next: title
  2566.  
  2567.  The optional ranges specify the region of the graph that will be displayed.
  2568.  
  2569.  Syntax:
  2570.        [{<dummy-var>=}{{<min>}:{<max>}}]
  2571.        [{{<min>}:{<max>}}]
  2572.  
  2573.  The first form applies to the independent variable (`xrange` (*note xrange:: )
  2574.  or  `trange` (*note trange:: ), if in parametric mode).  The second form
  2575.  applies to the dependent variable `yrange` (*note yrange:: ) (and xrange, too,
  2576.  if in parametric mode).  <dummy-var> is a new name for the independent
  2577.  variable.  (The defaults may be changed with `set dummy`.)  The optional <min>
  2578.  and <max> terms can be constant expressions or *.
  2579.  
  2580.  In non-parametric mode, the order in which ranges must be given is `xrange`
  2581.  and `yrange`.
  2582.  
  2583.  In parametric mode, the order for the `plot` (*note plot:: ) command is
  2584.  trange, xrange, and `yrange`.  The following `plot` command shows setting the
  2585.  `trange` to [-pi:pi], the `xrange` to [-1.3:1.3] and the `yrange` to [-1:1]
  2586.  for the duration of the graph:
  2587.  
  2588.        plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2
  2589.  
  2590.  Note that the x2range and y2range cannot be specified here---`set x2range`
  2591.  (*note x2range:: ) and `set y2range` (*note y2range:: ) must be used.
  2592.  
  2593.  Ranges are interpreted in the order listed above for the appropriate mode.
  2594.  Once all those needed are specified, no further ones must be listed, but
  2595.  unneeded ones cannot be skipped---use an empty range `[]` as a placeholder.
  2596.  
  2597.  `*` can be used to allow autoscaling of either of min and max.  See also
  2598.  `set autoscale` (*note autoscale:: ).
  2599.  
  2600.  Ranges specified on the `plot` or `splot` (*note splot:: ) command line affect
  2601.  only that graph; use the `set xrange`, `set yrange`, etc., commands to change
  2602.  the default ranges for future graphs.
  2603.  
  2604.  With time data, you must provide the range (in the same manner as the time
  2605.  appears in the datafile) within quotes.  `gnuplot` (*note gnuplot:: ) uses the
  2606.   `timefmt` (*note timefmt:: ) string to read the value---see `set timefmt`.
  2607.  
  2608.  Examples:
  2609.  
  2610.  This uses the current ranges:
  2611.        plot cos(x)
  2612.  
  2613.  This sets the x range only:
  2614.        plot [-10:30] sin(pi*x)/(pi*x)
  2615.  
  2616.  This is the same, but uses t as the dummy-variable:
  2617.        plot [t = -10 :30]  sin(pi*t)/(pi*t)
  2618.  
  2619.  This sets both the x and y ranges:
  2620.        plot [-pi:pi] [-3:3]  tan(x), 1/x
  2621.  
  2622.  This sets only the y range, and turns off autoscaling on both axes:
  2623.        plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)
  2624.  
  2625.  This sets xmax and ymin only:
  2626.        plot [:200] [-pi:]  exp(sin(x))
  2627.  
  2628.  This sets the x range for a timeseries:
  2629.        set timefmt "%d/%m/%y %H:%M"
  2630.        plot ["1/6/93 12:00":"5/6/93 12:00"] 'timedata.dat'
  2631.  
  2632.  
  2633. 
  2634. File: gnuplot.info, Node: title, Prev: ranges, Up: plot, Next: with
  2635.  
  2636.  A line title for each function and data set appears in the key, accompanied
  2637.  by a sample of the line and/or symbol used to represent it.  It can be
  2638.  changed by using the `title` option.
  2639.  
  2640.  Syntax:
  2641.        title "<title>" | notitle
  2642.  
  2643.  where <title> is the new title of the line and must be enclosed in quotes.
  2644.  The quotes will not be shown in the key.  A special character may be given as
  2645.  a backslash followed by its octal value ("\345").  The tab character "\t" is
  2646.  understood.  Note that backslash processing occurs only for strings enclosed
  2647.  in double quotes---use single quotes to prevent such processing.  The newline
  2648.  character "\n" is not processed in key entries in either type of string.
  2649.  
  2650.  The line title and sample can be omitted from the key by using the keyword
  2651.  `notitle`.  A null title (`title ''`) is equivalent to `notitle`.  If only
  2652.  the sample is wanted, use one or more blanks (`title ' '`).
  2653.  
  2654.  By default the line title is the function or file name as it appears on the
  2655.  `plot` (*note plot:: ) command.  If it is a file name, any datafile modifiers
  2656.  specified will be included in the default title.
  2657.  
  2658.  The layout of the key itself (position, title justification, etc.) can be
  2659.  controlled by `set key` (*note key:: ).  Please see set key for details.
  2660.  
  2661.  Examples:
  2662.  
  2663.  This plots y=x with the title 'x':
  2664.        plot x
  2665.  
  2666.  This plots x squared with title "x^2" and file "data.1" with title
  2667.  "measured data":
  2668.        plot x**2 title "x^2", 'data.1' t "measured data"
  2669.  
  2670.  This puts an untitled circular border around a polar graph:
  2671.        set polar; plot my_function(t), 1 notitle
  2672.  
  2673. 
  2674. File: gnuplot.info, Node: with, Prev: title, Up: plot
  2675.  
  2676.  Functions and data may be displayed in one of a large number of styles.
  2677.  The `with` keyword provides the means of selection.
  2678.  
  2679.  Syntax:
  2680.        with <style> { {linestyle | ls <line_style>}
  2681.                       | {{linetype | lt <line_type>}
  2682.                          {linewidth | lw <line_width>}
  2683.                          {pointtype | pt <point_type>}
  2684.                          {pointsize | ps <point_size>}} }
  2685.  
  2686.  where <style> is either `lines` (*note lines:: ),  `points` (*note points:: ),
  2687.   `linespoints` (*note linespoints:: ),  `impulses` (*note impulses:: ),
  2688.   `dots` (*note dots:: ), `steps` (*note steps:: ),  `fsteps`
  2689.  (*note fsteps:: ),  `histeps` (*note histeps:: ),  `errorbars`
  2690.  (*note errorbars:: ),  `xerrorbars` (*note xerrorbars:: ),  `yerrorbars`
  2691.  (*note yerrorbars:: ), `xyerrorbars` (*note xyerrorbars:: ),  `boxes`
  2692.  (*note boxes:: ),  `boxerrorbars` (*note boxerrorbars:: ),  `boxxyerrorbars`
  2693.  (*note boxxyerrorbars:: ),  `financebars` (*note financebars:: ),
  2694.  `candlesticks` (*note candlesticks:: ) or  `vector` (*note vector:: ).  Some
  2695.  of these styles require additional information.  See `set style <style>` for
  2696.  details of each style.
  2697.  
  2698.  Default styles are chosen with the `set function style`
  2699.  (*note function style:: ) and  `set data style` (*note data style:: )
  2700.  commands.
  2701.  
  2702.  By default, each function and data file will use a different line type and
  2703.  point type, up to the maximum number of available types.  All terminal
  2704.  drivers support at least six different point types, and re-use them, in
  2705.  order, if more are required.  The LaTeX driver supplies an additional six
  2706.  point types (all variants of a circle), and thus will only repeat after 12
  2707.  curves are plotted with points.  The PostScript drivers (`postscript`
  2708.  (*note postscript:: )) supplies a total of 64.
  2709.  
  2710.  If you wish to choose the line or point type for a single plot, <line_type>
  2711.  and <point_type> may be specified.  These are positive integer constants (or
  2712.  expressions) that specify the line type and point type to be used for the
  2713.  plot.  Use `test` (*note test:: ) to display the types available for your
  2714.  terminal.
  2715.  
  2716.  You may also scale the line width and point size for a plot by using
  2717.  <line_width> and <point_size>, which are specified relative to the default
  2718.  values for each terminal.  The pointsize may also be altered globally---see
  2719.  `set pointsize` (*note pointsize:: ) for details.  But note that both
  2720.  <point_size> as set here and as set by `set pointsize` multiply the default
  2721.  point size---their effects are not cumulative.  That is, `set pointsize 2;
  2722.  plot x w p ps 3` will use points three times default size, not six.
  2723.  
  2724.  If you have defined specific line type/width and point type/size combinations
  2725.  with `set linestyle` (*note linestyle:: ), one of these may be selected by
  2726.  setting <line_style> to the index of the desired style.
  2727.  
  2728.  The keywords may be abbreviated as indicated.
  2729.  
  2730.  Note that the `linewidth` (*note linewidth:: ) and pointsize options are not
  2731.  supported by all terminals.
  2732.  
  2733.  Examples:
  2734.  
  2735.  This plots sin(x) with impulses:
  2736.        plot sin(x) with impulses
  2737.  
  2738.  This plots x with points, x**2 with the default:
  2739.        plot x*y w points, x**2 + y**2
  2740.  
  2741.  This plots tan(x) with the default function style, file "data.1" with lines:
  2742.        plot [ ] [-2:5] tan(x), 'data.1' with l
  2743.  
  2744.  This plots "leastsq.dat" with impulses:
  2745.        plot 'leastsq.dat' w i
  2746.  
  2747.  This plots the data file "population" with boxes:
  2748.        plot 'population' with boxes
  2749.  
  2750.  This plots "exper.dat" with errorbars and lines connecting the points
  2751.  (errorbars require three or four columns):
  2752.        plot 'exper.dat' w lines, 'exper.dat' notitle w errorbars
  2753.  
  2754.  This plots sin(x) and cos(x) with linespoints, using the same line type but
  2755.  different point types:
  2756.        plot sin(x) with linesp lt 1 pt 3, cos(x) with linesp lt 1 pt 4
  2757.  
  2758.  This plots file "data" with points of type 3 and twice usual size:
  2759.        plot 'data' with points pointtype 3 pointsize 2
  2760.  
  2761.  This plots two data sets with lines differing only by weight:
  2762.        plot 'd1' t "good" w l lt 2 lw 3, 'd2' t "bad" w l lt 2 lw 1
  2763.  
  2764.  See `set style` (*note style:: ) to change the default styles.
  2765.  
  2766.  
  2767. 
  2768. File: gnuplot.info, Node: print, Prev: plot, Up: Commands, Next: pwd
  2769.  
  2770.  The `print` command prints the value of <expression> to the screen.  It is
  2771.  synonymous with `pause 0`.  <expression> may be anything that `gnuplot`
  2772.  (*note gnuplot:: ) can evaluate that produces a number, or it can be a
  2773.  string.
  2774.  
  2775.  Syntax:
  2776.        print <expression> {, <expression>, ...}
  2777.  
  2778.  See `expressions` (*note Expressions:: ).
  2779.  
  2780.  
  2781. 
  2782. File: gnuplot.info, Node: pwd, Prev: print, Up: Commands, Next: quit
  2783.  
  2784.  The `pwd` command prints the name of the working directory to the screen.
  2785.  
  2786. 
  2787. File: gnuplot.info, Node: quit, Prev: pwd, Up: Commands, Next: replot
  2788.  
  2789.  The `exit` (*note exit:: ) and quit commands and END-OF-FILE character will
  2790.  exit it `gnuplot` (*note gnuplot:: ). Each of these commands will clear the
  2791.  output device (as does the `clear` (*note clear:: ) command) before exiting.
  2792.  
  2793.  
  2794. 
  2795. File: gnuplot.info, Node: replot, Prev: quit, Up: Commands, Next: reread
  2796.  
  2797.  The `replot` command without arguments repeats the last `plot` (*note plot:: )
  2798.  or  `splot` (*note splot:: ) command.  This can be useful for viewing a plot
  2799.  with different `set` (*note set-show:: ) options, or when generating the same
  2800.  plot for several devices.
  2801.  
  2802.  Arguments specified after a `replot` command will be added onto the last
  2803.  `plot` or `splot` command (with an implied ',' separator) before it is
  2804.  repeated.  `replot` accepts the same arguments as the `plot` and `splot`
  2805.  commands except that ranges cannot be specified.  Thus you can use `replot`
  2806.  to plot a function against the second axes if the previous command was `plot`
  2807.  but not if it was `splot`, and similarly you can use `replot` to add a plot
  2808.  from a binary file only if the previous command was `splot`.
  2809.  
  2810.  N.B.---use of
  2811.  
  2812.        plot '-' ; ... ; replot
  2813.  
  2814.  is not recommended.  `gnuplot` (*note gnuplot:: ) does not store the inline
  2815.  data internally, so since `replot` appends new information to the previous
  2816.  `plot` and then executes the modified command, the `'-'` from the initial
  2817.  `plot` will expect to read inline data again.
  2818.  
  2819.  Note that `replot` does not work in `multiplot` (*note multiplot:: ) mode,
  2820.  since it reproduces only the last plot rather than the entire screen.
  2821.  
  2822.  See also `command-line-editing` (*note Command-line-editing:: ) for ways to
  2823.  edit the last plot (splot) command.
  2824.  
  2825.  
  2826. 
  2827. File: gnuplot.info, Node: reread, Prev: replot, Up: Commands, Next: reset
  2828.  
  2829.  The `reread` command causes the current `gnuplot` (*note gnuplot:: ) command
  2830.  file, as specified by a `load` (*note load:: ) command or on the command line,
  2831.  to be reset to its starting point before further commands are read from
  2832.  it.  This essentially implements an endless loop of the commands from the
  2833.  beginning of the command file to the `reread` command.  (But this is not
  2834.  necessarily a disaster---`reread` can be very useful when used in conjunction
  2835.  with `if` (*note if:: ).  See if for details.) The `reread` command has no
  2836.  effect if input from standard input.
  2837.  
  2838.  Examples:
  2839.  
  2840.  Suppose the file "looper" contains the commands
  2841.        a=a+1
  2842.        plot sin(x*a)
  2843.        pause -1
  2844.        if(a<5) reread
  2845.  and from within `gnuplot` you submit the commands
  2846.        a=0
  2847.        load 'looper'
  2848.  The result will be four plots (separated by the `pause` (*note pause:: )
  2849.  message).
  2850.  
  2851.  Suppose the file "data" contains six columns of numbers with a total yrange
  2852.  from 0 to 10; the first is x and the next are five different functions of x.
  2853.  Suppose also that the file "plotter" contains the commands
  2854.        c_p = c_p+1
  2855.        plot "$0" using 1:c_p with lines linetype c_p
  2856.        if(c_p <  n_p) reread
  2857.  and from within `gnuplot` you submit the commands
  2858.        n_p=6
  2859.        c_p=1
  2860.        set nokey
  2861.        set yrange [0:10]
  2862.        set multiplot
  2863.        call 'plotter' 'data'
  2864.        set nomultiplot
  2865.  The result is a single graph consisting of five plots.  The yrange must be
  2866.  set explicitly to guarantee that the five separate graphs (drawn on top of
  2867.  each other in multiplot mode) will have exactly the same axes.  The linetype
  2868.  must be specified; otherwise all the plots would be drawn with the same type.
  2869.  
  2870. 
  2871. File: gnuplot.info, Node: reset, Prev: reread, Up: Commands, Next: save
  2872.  
  2873.  The `reset` command causes all options that can be set with the `set`
  2874.  (*note set-show:: ) command to take on their default values.  The only
  2875.  exceptions are that the terminal set with `set term` (*note terminal:: ) and
  2876.  the output file set with  `set output` (*note output:: ) are left
  2877.  unchanged.  This command is useful, e.g., to restore the default settings at
  2878.  the end of a command file, or to return to a defined state after lots of
  2879.  settings have been changed within a command file.  Please refer to the `set`
  2880.  command to see the default values that the various options take.
  2881.  
  2882.  
  2883. 
  2884. File: gnuplot.info, Node: save, Prev: reset, Up: Commands, Next: set-show
  2885.  
  2886.  The `save` command saves user-defined functions, variables, `set`
  2887.  (*note set-show:: ) options, or all three, plus the last `plot`
  2888.  (*note plot:: ) ((`splot` (*note splot:: )) command to the specified file.
  2889.  
  2890.  Syntax:
  2891.        save  {<option>} '<filename>'
  2892.  
  2893.  where <option> is `functions` (*note functions:: ),  `variables`
  2894.  (*note variables:: ) or set. If no option is used, `gnuplot`
  2895.  (*note gnuplot:: ) saves functions, variables, set options and the last plot
  2896.  (`splot`) command.
  2897.  
  2898.  `save`d files are written in text format and may be read by the `load`
  2899.  (*note load:: ) command.
  2900.  
  2901.  The filename must be enclosed in quotes.
  2902.  
  2903.  Examples:
  2904.        save 'work.gnu'
  2905.        save functions 'func.dat'
  2906.        save var 'var.dat'
  2907.        save set 'options.dat'
  2908.  
  2909. 
  2910. File: gnuplot.info, Node: set-show, Prev: save, Up: Commands, Next: angles
  2911.  
  2912.  The `set` command can be used to sets _lots_ of options.  No screen is
  2913.  drawn, however, until a `plot` (*note plot:: ),  `splot` (*note splot:: ), or
  2914.   `replot` (*note replot:: ) command is given.
  2915.  
  2916.  The `show` command shows their settings;  `show all` shows all the
  2917.  settings.
  2918.  
  2919.  If a variable contains time/date data, `show` will display it according to
  2920.  the format currently defined by `set timefmt` (*note timefmt:: ), even if that
  2921.  was not in effect when the variable was initially defined.
  2922.  
  2923.  
  2924. * Menu:
  2925.  
  2926. * angles::
  2927. * arrow::
  2928. * autoscale::
  2929. * bar::
  2930. * bmargin::
  2931. * border::
  2932. * boxwidth::
  2933. * clabel::
  2934. * clip::
  2935. * cntrparam::
  2936. * contour::
  2937. * data style::
  2938. * dgrid3d::
  2939. * dummy::
  2940. * encoding::
  2941. * format::
  2942. * function style::
  2943. * functions::
  2944. * grid::
  2945. * hidden3d::
  2946. * isosamples::
  2947. * key::
  2948. * label::
  2949. * linestyle::
  2950. * lmargin::
  2951. * locale::
  2952. * logscale::
  2953. * mapping::
  2954. * margin::
  2955. * missing::
  2956. * multiplot::
  2957. * mx2tics::
  2958. * mxtics::
  2959. * my2tics::
  2960. * mytics::
  2961. * mztics::
  2962. * offsets::
  2963. * origin::
  2964. * output::
  2965. * parametric::
  2966. * pointsize::
  2967. * polar::
  2968. * rmargin::
  2969. * rrange::
  2970. * samples::
  2971. * size::
  2972. * style::
  2973. * surface::
  2974. * terminal::
  2975. * tics::
  2976. * ticslevel::
  2977. * ticscale::
  2978. * timestamp::
  2979. * timefmt::
  2980. * title::
  2981. * tmargin::
  2982. * trange::
  2983. * urange::
  2984. * variables::
  2985. * version::
  2986. * view::
  2987. * vrange::
  2988. * x2data::
  2989. * x2dtics::
  2990. * x2label::
  2991. * x2mtics::
  2992. * x2range::
  2993. * x2tics::
  2994. * x2zeroaxis::
  2995. * xdata::
  2996. * xdtics::
  2997. * xlabel::
  2998. * xmtics::
  2999. * xrange::
  3000. * xtics::
  3001. * xzeroaxis::
  3002. * y2data::
  3003. * y2dtics::
  3004. * y2label::
  3005. * y2mtics::
  3006. * y2range::
  3007. * y2tics::
  3008. * y2zeroaxis::
  3009. * ydata::
  3010. * ydtics::
  3011. * ylabel::
  3012. * ymtics::
  3013. * yrange::
  3014. * ytics::
  3015. * yzeroaxis::
  3016. * zdata::
  3017. * zdtics::
  3018. * zero::
  3019. * zeroaxis::
  3020. * zlabel::
  3021. * zmtics::
  3022. * zrange::
  3023. * ztics::
  3024.  
  3025. 
  3026. File: gnuplot.info, Node: angles, Prev: set-show, Up: set-show, Next: arrow
  3027.  
  3028.  By default, `gnuplot` (*note gnuplot:: ) assumes the independent variable in
  3029.  polar graphs is in units of radians.  If `set angles degrees` is specified
  3030.  before `set polar` (*note polar:: ), then the default range is [0:360] and the
  3031.  independent variable has units of degrees.  This is particularly useful for
  3032.  plots of data files.  The angle setting also applies to 3-d mapping as set via
  3033.  the `set mapping` (*note mapping:: ) command.
  3034.  
  3035.  Syntax:
  3036.        set angles {degrees | radians}
  3037.        show angles
  3038.  
  3039.  The angle specified in `set grid polar` is also read and displayed in the
  3040.  units specified by `set angles`.
  3041.  
  3042.  `set angles` also affects the arguments of the machine-defined functions
  3043.  sin(x), cos(x) and tan(x), and the outputs of asin(x), acos(x), atan(x),
  3044.  atan2(x), and arg(x).  It has no effect on the arguments of hyperbolic
  3045.  functions or Bessel functions.  However, the output arguments of inverse
  3046.  hyperbolic functions of complex arguments are affected; if these functions
  3047.  are used, `set angles radians` must be in effect to maintain consistency
  3048.  between input and output arguments.
  3049.  
  3050.        x={1.0,0.1}
  3051.        set angles radians
  3052.        y=sinh(x)
  3053.        print y         #prints {1.16933, 0.154051}
  3054.        print asinh(y)  #prints {1.0, 0.1}
  3055.  but
  3056.        set angles degrees
  3057.        y=sinh(x)
  3058.        print y         #prints {1.16933, 0.154051}
  3059.        print asinh(y)  #prints {57.29578, 5.729578}
  3060.  
  3061. 
  3062. File: gnuplot.info, Node: arrow, Prev: angles, Up: set-show, Next: autoscale
  3063.  
  3064.  Arbitrary arrows can be placed on a plot using the `set arrow` command.
  3065.  
  3066.  Syntax:
  3067.        set arrow {<tag>} {from <position>} {to <position>} {{no}head}
  3068.                  { {linestyle | ls <line_style>}
  3069.                    | {linetype | lt <line_type>}
  3070.                      {linewidth | lw <line_width} }
  3071.        set noarrow {<tag>}
  3072.        show arrow
  3073.  
  3074.  <tag> is an integer that identifies the arrow.  If no tag is given, the
  3075.  lowest unused tag value is assigned automatically.  The tag can be used to
  3076.  delete or change a specific arrow.  To change any attribute of an existing
  3077.  arrow, use the `set arrow` command with the appropriate tag and specify the
  3078.  parts of the arrow to be changed.
  3079.  
  3080.  The <position>s are specified by either x,y or x,y,z, and may be preceded by
  3081.  `first`, `second`, `graph`, or `screen` to select the coordinate system.
  3082.  Unspecified coordinates default to 0.  The endpoints can be specified in
  3083.  one of four coordinate systems---`first` or `second` axes, `graph` or
  3084.  `screen`.  See `coordinates` (*note Coordinates:: ) for details.  A coordinate
  3085.  system specifier does not carry over from the "from" position to the "to"
  3086.  position.  Arrows outside the screen boundaries are permitted but may cause
  3087.  device errors.
  3088.  
  3089.  Specifying `nohead` produces an arrow drawn without a head---a line segment.
  3090.  This gives you yet another way to draw a line segment on the plot.  By
  3091.  default, arrows have heads.
  3092.  
  3093.  The line style may be selected from a user-defined list of line styles (see
  3094.  `set linestyle` (*note linestyle:: )) or may be defined here by providing
  3095.  values for <line_type> (an index from the default list of styles) and/or
  3096.  <line_width> (which is a multiplier for the default width).
  3097.  
  3098.  Note, however, that if a user-defined line style has been selected, its
  3099.  properties (type and width) cannot be altered merely by issuing another
  3100.  `set arrow` command with the appropriate index and `lt` or `lw`.
  3101.  
  3102.  Examples:
  3103.  
  3104.  To set an arrow pointing from the origin to (1,2) with user-defined style 5,
  3105.  use:
  3106.        set arrow to 1,2 ls 5
  3107.  
  3108.  To set an arrow from bottom left of plotting area to (-5,5,3), and tag the
  3109.  arrow number 3, use:
  3110.        set arrow 3 from graph 0,0 to -5,5,3
  3111.  
  3112.  To change the preceding arrow to end at 1,1,1, without an arrow head and
  3113.  double its width, use:
  3114.        set arrow 3 to 1,1,1 nohead lw 2
  3115.  
  3116.  To draw a vertical line from the bottom to the top of the graph at x=3, use:
  3117.        set arrow from 3, graph 0 to 3, graph 1 nohead
  3118.  
  3119.  To delete arrow number 2, use:
  3120.        set noarrow 2
  3121.  
  3122.  To delete all arrows, use:
  3123.        set noarrow
  3124.  
  3125.  To show all arrows (in tag order), use:
  3126.        show arrow
  3127.  
  3128. 
  3129. File: gnuplot.info, Node: autoscale, Prev: arrow, Up: set-show, Next: parametric mode
  3130.  
  3131.  Autoscaling may be set individually on the x, y or z axis or globally on all
  3132.  axes. The default is to autoscale all axes.
  3133.  
  3134.  Syntax:
  3135.        set autoscale {<axes>{min|max}}
  3136.        set noautoscale {<axes>{min|max}}
  3137.        show autoscale
  3138.  
  3139.  where <axes> is either `x`, `y`, `z`, `x2`, `y2` or `xy`.  A keyword with
  3140.  `min` or `max` appended (this cannot be done with `xy`) tells `gnuplot`
  3141.  (*note gnuplot:: ) to autoscale just the minimum or maximum of that axis.  If
  3142.  no keyword is given, all axes are autoscaled.
  3143.  
  3144.  When autoscaling, the axis range is automatically computed and the dependent
  3145.  axis (y for a `plot` (*note plot:: ) and z for  `splot` (*note splot:: )) is
  3146.  scaled to include the range of the function or data being plotted.
  3147.  
  3148.  If autoscaling of the dependent axis (y or z) is not set, the current y or z
  3149.  range is used.
  3150.  
  3151.  Autoscaling the independent variables (x for `plot` and x,y for `splot`) is a
  3152.  request to set the domain to match any data file being plotted.  If there are
  3153.  no data files, autoscaling an independent variable has no effect.  In other
  3154.  words, in the absence of a data file, functions alone do not affect the x
  3155.  range (or the y range if plotting z = f(x,y)).
  3156.  
  3157.  Please see `set xrange` (*note xrange:: ) for additional information about
  3158.  ranges.
  3159.  
  3160.  The behavior of autoscaling remains consistent in parametric mode, (see `set
  3161.  parametric`).  However, there are more dependent variables and hence more
  3162.  control over x, y, and z axis scales.  In parametric mode, the independent or
  3163.  dummy variable is t for `plot`s and u,v for `splot`s.  `autoscale` in
  3164.  parametric mode, then, controls all ranges (t, u, v, x, y, and z) and allows
  3165.  x, y, and z to be fully autoscaled.
  3166.  
  3167.  Autoscaling works the same way for polar mode as it does for parametric mode
  3168.  for `plot`, with the extension that in polar mode `set dummy` (*note dummy:: )
  3169.  can be used to change the independent variable from t (see `set dummy`).
  3170.  
  3171.  When tics are displayed on second axes but no plot has been specified for
  3172.  those axes, x2range and y2range are inherited from xrange and yrange.  This
  3173.  is done _before_ xrange and yrange are autoextended to a whole number of
  3174.  tics, which can cause unexpected results.
  3175.  
  3176.  Examples:
  3177.  
  3178.  This sets autoscaling of the y axis (other axes are not affected):
  3179.        set autoscale y
  3180.  
  3181.  This sets autoscaling only for the minimum of the y axis (the maximum of the
  3182.  y axis and the other axes are not affected):
  3183.        set autoscale ymin
  3184.  
  3185.  This sets autoscaling of the x and y axes:
  3186.        set autoscale xy
  3187.  
  3188.  This sets autoscaling of the x, y, z, x2 and y2 axes:
  3189.        set autoscale
  3190.  
  3191.  This disables autoscaling of the x, y, z, x2 and y2 axes:
  3192.        set noautoscale
  3193.  
  3194.  This disables autoscaling of the z axis only:
  3195.        set noautoscale z
  3196.  
  3197. * Menu:
  3198.  
  3199. * parametric mode::
  3200. * polar mode::
  3201.  
  3202. 
  3203. File: gnuplot.info, Node: parametric mode, Prev: autoscale, Up: autoscale, Next: polar mode
  3204.  
  3205.  When in parametric mode (`set parametric` (*note parametric:: )), the xrange
  3206.  is as fully scalable as the y range.  In other words, in parametric mode the x
  3207.  axis can be automatically scaled to fit the range of the parametric function
  3208.  that is being plotted.  Of course, the y axis can also be automatically scaled
  3209.  just as in the non-parametric case.  If autoscaling on the x axis is not set,
  3210.  the current x range is used.
  3211.  
  3212.  Data files are plotted the same in parametric and non-parametric mode.
  3213.  However, there is a difference in mixed function and data plots: in
  3214.  non-parametric mode with autoscaled x, the x range of the datafile controls
  3215.  the x range of the functions; in parametric mode it has no influence.
  3216.  
  3217.  For completeness a last command `set autoscale t` is accepted.  However, the
  3218.  effect of this "scaling" is very minor.  When `gnuplot` (*note gnuplot:: )
  3219.  determines that the t range would be empty, it makes a small adjustment if
  3220.  autoscaling is true. Otherwise, `gnuplot` gives an error.  Such behavior may,
  3221.  in fact, not be very useful and the command `set autoscale t` is certainly
  3222.  questionable.
  3223.  
  3224.  `splot` (*note splot:: ) extends the above ideas as you would expect.  If
  3225.  autoscaling is set, then x, y, and z ranges are computed and each axis scaled
  3226.  to fit the resulting data.
  3227.  
  3228.  
  3229. 
  3230. File: gnuplot.info, Node: polar mode, Prev: parametric mode, Up: autoscale
  3231.  
  3232.  When in polar mode (`set polar` (*note polar:: )), the xrange and the yrange
  3233.  are both found from the polar coordinates, and thus they can both be
  3234.  automatically scaled. In other words, in polar mode both the x and y axes can
  3235.  be automatically scaled to fit the ranges of the polar function that is being
  3236.  plotted.
  3237.  
  3238.  When plotting functions in polar mode, the rrange may be autoscaled.  When
  3239.  plotting data files in polar mode, the trange may also be autoscaled.  Note
  3240.  that if the trange is contained within one quadrant, autoscaling will produce
  3241.  a polar plot of only that single quadrant.
  3242.  
  3243.  Explicitly setting one or two ranges but not others may lead to unexpected
  3244.  results.
  3245.  
  3246. 
  3247. File: gnuplot.info, Node: bar, Prev: autoscale, Up: set-show, Next: bmargin
  3248.  
  3249.  The `set bar` command controls the tics at the ends of errorbars.
  3250.  
  3251.  Syntax:
  3252.        set bar {small | large | <size>}
  3253.        show bar
  3254.  
  3255.  `small` is a synonym for 0.0, and `large` for 1.0.
  3256.  The default is 1.0 if no size is given.
  3257.  
  3258. 
  3259. File: gnuplot.info, Node: bmargin, Prev: bar, Up: set-show, Next: border
  3260.  
  3261.  The command `set bmargin` sets the size of the bottom margin.  Please see
  3262.  `set margin` (*note margin:: ) for details.
  3263.  
  3264.  
  3265. 
  3266. File: gnuplot.info, Node: border, Prev: bmargin, Up: set-show, Next: boxwidth
  3267.  
  3268.  The `set border` and `set noborder` commands control the display of the graph
  3269.  borders for the `plot` (*note plot:: ) and  `splot` (*note splot:: )
  3270.  commands.
  3271.  
  3272.  Syntax:
  3273.        set border {<integer> { {linestyle | ls <line_style>}
  3274.                                | {linetype | lt <line_type> }
  3275.                                  {linewidth | lw <line_width>} } }
  3276.        set noborder
  3277.        show border
  3278.  
  3279.  The borders are encoded in a 12-bit integer: the bottom four bits control the
  3280.  border for `plot` and the sides of the base for `splot`; The next four bits
  3281.  control the verticals in `splot`; the top four bits control the edges on top
  3282.  of the `splot`.  In detail, the `<integer>` should be the sum of the
  3283.  appropriate entries from the following table:
  3284.  
  3285.                          plot border     splot         splot
  3286.            Side          splot base    verticals        top
  3287.        bottom (south)         1            16           256
  3288.        left   (west)          2            32           512
  3289.        top    (north)         4            64          1024
  3290.        right  (east)          8           128          2048
  3291.  
  3292.  The default is 31, which is all four sides for `plot`, and base and z axis
  3293.  for `splot`.
  3294.  
  3295.  Using the optional <line_style>, <line_type> and <line_width>
  3296.  specifiers, the way the border lines are drawn can be influenced
  3297.  (limited by what the current terminal driver supports).  By default,
  3298.  the border is drawn with twice the usual linewidth.  The <line_width>
  3299.  specifier scales this default value; for example, `set border 15 lw 2`
  3300.  will produce a border with four times the usual linewidth.
  3301.  
  3302.  Various axes or combinations of axes may be added together in the command.
  3303.  
  3304.  To have tics on edges other than bottom and left, disable the usual tics and
  3305.  enable the second axes.
  3306.  
  3307.  Examples:
  3308.  
  3309.  Draw all borders:
  3310.        set border
  3311.  
  3312.  Draw only the SOUTHWEST borders:
  3313.        set border 3
  3314.  
  3315.  Draw a complete box around a `splot`:
  3316.        set border 4095
  3317.  
  3318.  Draw a partial box, omitting the front vertical:
  3319.        set border 127+256+512
  3320.  
  3321.  Draw only the NORTHEAST borders:
  3322.        set noxtics; set noytics; set x2tics; set y2tics; set border 12
  3323.  
  3324.  
  3325. 
  3326. File: gnuplot.info, Node: boxwidth, Prev: border, Up: set-show, Next: clabel
  3327.  
  3328.  The `set boxwidth` command is used to set the default width of boxes in the
  3329.  `boxes` (*note boxes:: ) and  `boxerrorbars` (*note boxerrorbars:: ) styles.
  3330.  
  3331.  Syntax:
  3332.        set boxwidth {<width>}
  3333.        show boxwidth
  3334.  
  3335.  If a data file is plotted without the width being specified in the third,
  3336.  fourth, or fifth column (or `using` (*note using:: ) entry), or if a function
  3337.  is plotted, the width of each box is set by the `set boxwidth` command.  (If a
  3338.  width is given both in the file and by the `set boxwidth` command, the one in
  3339.  the file is used.)  If the width is not specified in one of these ways, the
  3340.  width of each box will be calculated automatically so that it touches the
  3341.  adjacent boxes. In a four-column data set, the fourth column will be
  3342.  interpreted as the box width unless the width is set to -2.0, in which case
  3343.  the width will be calculated automatically.  See `set style boxerrorbars` for
  3344.  more details.
  3345.  
  3346.  To set the box width to automatic use the command
  3347.        set boxwidth
  3348.  or, for four-column data,
  3349.        set boxwidth -2
  3350.  
  3351.  The same effect can be achieved with the `using` keyword in `plot`
  3352.  (*note plot:: ):       plot 'file' using 1:2:3:4:(-2)
  3353.  
  3354.  
  3355. 
  3356. File: gnuplot.info, Node: clabel, Prev: boxwidth, Up: set-show, Next: clip
  3357.  
  3358.  `gnuplot` (*note gnuplot:: ) will vary the linetype used for each contour
  3359.  level when clabel is set.  When this option on (the default), a legend labels
  3360.  each linestyle with the z level it represents.  It is not possible at present
  3361.  to separate the contour labels from the surface key.
  3362.  
  3363.  Syntax:
  3364.        set clabel {'<format>'}
  3365.        set noclabel
  3366.        show clabel
  3367.  
  3368.  The default for the format string is %8.3g, which gives three decimal places.
  3369.  This may produce poor label alignment if the key is altered from its default
  3370.  configuration.
  3371.  
  3372.  The first contour linetype, or only contour linetype when clabel is off, is
  3373.  the surface linetype +1; contour points are the same style as surface points.
  3374.  
  3375.  See also `set contour` (*note contour:: ).
  3376.  
  3377.  
  3378. 
  3379. File: gnuplot.info, Node: clip, Prev: clabel, Up: set-show, Next: cntrparam
  3380.  
  3381.  `gnuplot` (*note gnuplot:: ) can clip data points and lines that are near the
  3382.  boundaries of a graph.
  3383.  
  3384.  Syntax:
  3385.        set clip <clip-type>
  3386.        set noclip <clip-type>
  3387.        show clip
  3388.  
  3389.  Three clip types are supported by `gnuplot`: `points` (*note points:: ), one,
  3390.  and two. One, two, or all three clip types may be active for a single graph.
  3391.  
  3392.  The `points` clip type forces `gnuplot` to clip (actually, not plot at all)
  3393.  data points that fall within but too close to the boundaries.  This is done
  3394.  so that large symbols used for points will not extend outside the boundary
  3395.  lines.  Without clipping points near the boundaries, the plot may look bad.
  3396.  Adjusting the x and y ranges may give similar results.
  3397.  
  3398.  Setting the `one` clip type causes `gnuplot` to draw a line segment which has
  3399.  only one of its two endpoints within the graph.  Only the in-range portion of
  3400.  the line is drawn.  The alternative is to not draw any portion of the line
  3401.  segment.
  3402.  
  3403.  Some lines may have both endpoints out of range, but pass through the graph.
  3404.  Setting the `two` clip-type allows the visible portion of these lines to be
  3405.  drawn.
  3406.  
  3407.  In no case is a line drawn outside the graph.
  3408.  
  3409.  The defaults are `noclip points`, `clip one`, and `noclip two`.
  3410.  
  3411.  To check the state of all forms of clipping, use
  3412.        show clip
  3413.  
  3414.  For backward compatibility with older versions, the following forms are also
  3415.  permitted:
  3416.        set clip
  3417.        set noclip
  3418.  
  3419.  `set clip` is synonymous with `set clip points`; `set noclip` turns off all
  3420.  three types of clipping.
  3421.  
  3422. 
  3423. File: gnuplot.info, Node: cntrparam, Prev: clip, Up: set-show, Next: contour
  3424.  
  3425.  `set cntrparam` controls the generation of contours and their smoothness for
  3426.  a contour plot. `show contour` (*note contour:: ) displays current settings of
  3427.  cntrparam as well as `contour`.
  3428.  
  3429.  Syntax:
  3430.        set cntrparam {  {linear | cubicspline | bspline}
  3431.                        { points <n>} { order <n> }
  3432.                        { levels   auto {<n>} | <n>
  3433.                                 | discrete <z1> {,<z2>{,<z3>...}}
  3434.                                 | incremental <start>, <incr> {,<end>}
  3435.                         }
  3436.                       }
  3437.        show contour
  3438.  
  3439.  This command has two functions.  First, it sets the values of z for which
  3440.  contour points are to be determined (by linear interpolation between data
  3441.  points or function isosamples.)  Second, it controls the way contours are
  3442.  drawn between the points determined to be of equal z.  <n> should be an
  3443.  integral constant expression and <z1>, <z2> ... any constant expressions.
  3444.  The parameters are:
  3445.  
  3446.  `linear`, `cubicspline`, `bspline`---Controls type of approximation or
  3447.  interpolation.  If `linear`, then straight line segments connect points of
  3448.  equal z magnitude.  If `cubicspline`, then piecewise-linear contours are
  3449.  interpolated between the same equal z points to form somewhat smoother
  3450.  contours, but which may undulate.  If `bspline`, a guaranteed-smoother curve
  3451.  is drawn, which only approximates the position of the points of equal-z.
  3452.  
  3453.  `points` (*note points:: )---Eventually all drawings are done with
  3454.  piecewise-linear strokes. This number controls the number of line segments
  3455.  used to approximate the `bspline` or `cubicspline` curve.  Number of
  3456.  cubicspline or bspline segments (strokes) = `points` * number of linear
  3457.  segments.
  3458.  
  3459.  `order`---Order of the bspline approximation to be used.  The bigger this
  3460.  order is, the smoother the resulting contour.  (Of course, higher order
  3461.  bspline curves will move further away from the original piecewise linear
  3462.  data.)  This option is relevant for `bspline` mode only.  Allowed values are
  3463.  integers in the range from 2 (linear) to 10.
  3464.  
  3465.  `levels`--- Selection of contour levels,  controlled by `auto` (default),
  3466.  `discrete`, `incremental`, and <n>, number of contour levels, limited to
  3467.   MAX_DISCRETE_LEVELS as defined in plot.h (30 is standard.)
  3468.  
  3469.  For `auto`, <n> specifies a nominal number of levels; the actual number will
  3470.  be adjusted to give simple labels. If the surface is bounded by zmin and zmax,
  3471.  contours will be generated at integer multiples of dz between zmin and zmax,
  3472.  where dz is 1, 2, or 5 times some power of ten (like the step between two
  3473.  tic marks).
  3474.  
  3475.  For `levels discrete`, contours will be generated at z = <z1>, <z2> ... as
  3476.  specified; the number of discrete levels sets the number of contour levels.
  3477.  In `discrete` mode, any `set cntrparms levels <n>` are ignored.
  3478.  
  3479.  For `incremental`, contours are generated at values of z beginning at <start>
  3480.  and increasing by <increment>, until the number of contours is reached. <end>
  3481.  is used to determine the number of contour levels, which will be changed by
  3482.  any subsequent `set cntrparam levels <n>`.
  3483.  
  3484.  If the command `set cntrparam` is given without any arguments specified,  the
  3485.  defaults are used: linear, 5 points, order 4, 5 auto levels.
  3486.  
  3487.  Examples:
  3488.        set cntrparam bspline
  3489.        set cntrparam points 7
  3490.        set cntrparam order 10
  3491.  
  3492.  To select levels automatically, 5 if the level increment criteria are met:
  3493.        set cntrparam levels auto 5
  3494.  
  3495.  To specify discrete levels at .1, .37, and .9:
  3496.        set cntrparam levels discrete .1,1/exp(1),.9
  3497.  
  3498.  To specify levels from 0 to 4 with increment 1:
  3499.        set cntrparam levels incremental  0,1,4
  3500.  
  3501.  To set the number of levels to 10 (changing an incremental end or possibly
  3502.  the number of auto levels):
  3503.        set cntrparam levels 10
  3504.  
  3505.  To set the start and increment while retaining the number of levels:
  3506.        set cntrparam levels incremental 100,50
  3507.  
  3508.  See also `set contour` for control of where the contours are drawn, and `set
  3509.  clabel` for control of the format of the contour labels and linetypes.
  3510.  
  3511. 
  3512. File: gnuplot.info, Node: contour, Prev: cntrparam, Up: set-show, Next: data style
  3513.  
  3514.  `set contour` enables contour drawing for surfaces. This option is available
  3515.  for `splot` (*note splot:: ) only.
  3516.  
  3517.  Syntax:
  3518.        set contour {base | surface | both}
  3519.        set nocontour
  3520.        show contour
  3521.  
  3522.  The three options specify where to draw the contours: `base` draws the
  3523.  contours on the grid base where the x/ytics are placed, `surface`
  3524.  (*note surface:: ) draws the contours on the surfaces themselves, and `both`
  3525.  draws the contours on both the base and the surface.  If no option is
  3526.  provided, the default is `base`.
  3527.  
  3528.  See also `set cntrparam` (*note cntrparam:: ) for the parameters that affect
  3529.  the drawing of contours, and `set clabel` (*note clabel:: ) for control of
  3530.  labelling of the contours.
  3531.  
  3532.  The surface can be switched off (see `set surface`), giving a contour-only
  3533.  graph.  Though it is possible to use `set size` (*note size:: ) to enlarge the
  3534.  plot to fill the screen, more control over the output format can be obtained
  3535.  by writing the contour information to a file, and rereading it as a 2-d
  3536.  datafile plot:
  3537.  
  3538.        set nosurface
  3539.        set contour
  3540.        set cntrparam ...
  3541.        set term table
  3542.        set out 'filename'
  3543.        splot ...
  3544.        set out
  3545.        # contour info now in filename
  3546.        set term <whatever>
  3547.        plot 'filename'
  3548.  
  3549.  In order to draw contours, the data should be organized as "grid data".  In
  3550.  such a file all the points for a single y-isoline are listed, then all the
  3551.  points for the next y-isoline, and so on.  A single blank line (a line
  3552.  containing no characters other than blank spaces and a carriage return and/or
  3553.  a line feed) separates one y-isoline from the next.  See also `splot datafile`
  3554.  (*note data-file:: ).
  3555.  
  3556.  If contours are desired from non-grid data, `set dgrid3d` (*note dgrid3d:: )
  3557.  can be used to create an appropriate grid.  See `set dgrid3d` for more
  3558.  information.
  3559.  
  3560.  
  3561. 
  3562. File: gnuplot.info, Node: data style, Prev: contour, Up: set-show, Next: dgrid3d
  3563.  
  3564.  The `set data style` command changes the default plotting style for data
  3565.  plots.
  3566.  
  3567.  Syntax:
  3568.        set data style <style-choice>
  3569.        show data style
  3570.  
  3571.  See `set style` (*note style:: ) for the choices.  If no choice is given, the
  3572.  choices are listed.  `show data style` shows the current default data plotting
  3573.  style.
  3574.  
  3575.  
  3576. 
  3577. File: gnuplot.info, Node: dgrid3d, Prev: data style, Up: set-show, Next: dummy
  3578.  
  3579.  The `set dgrid3d` command enables, and can set parameters for, non-grid
  3580.  to grid data mapping.
  3581.  
  3582.  Syntax:
  3583.        set dgrid3d {<row_size>} {,{<col_size>} {,<norm>}}
  3584.        set nodgrid3d
  3585.        show dgrid3d
  3586.  
  3587.  By default `dgrid3d` is disabled.  When enabled, 3-d data read from a file
  3588.  are always treated as a scattered data set.  A grid with dimensions derived
  3589.  from a bounding box of the scattered data and size as specified by the
  3590.  row/col_size parameters is created for plotting and contouring.  The grid
  3591.  is equally spaced in x (rows) and in y (columns); the z values are computed
  3592.  as weighted averages of the scattered points' z values.
  3593.  
  3594.  The third parameter, norm, controls the weighting:  Each data point is
  3595.  weighted inversely by its distance from the grid point raised to the norm
  3596.  power.  (Actually, the weights are given by the inverse of dx^norm + dy^norm,
  3597.  where dx and dy are the components of the separation of the grid point from
  3598.  each data point.  For some norms that are powers of two, specifically 4, 8,
  3599.  and 16, the computation is optimized by using the Euclidean distance in the
  3600.  weight calculation, (dx^2+dx^2)^norm/2.  However, any non-negative integer
  3601.  can be used.)
  3602.  
  3603.  The closer the data point is to a grid point, the more effect it has on
  3604.  that grid point and the larger the value of norm the less effect more
  3605.  distant data points have on that grid point.
  3606.  
  3607.  The `dgrid3d` option is a simple low pass filter that converts scattered
  3608.  data to a grid data set.  More sophisticated approaches to this problem
  3609.  exist and should be used to preprocess the data outside `gnuplot`
  3610.  (*note gnuplot:: ) if this simple solution is found inadequate.
  3611.  
  3612.  (The z values are found by weighting all data points, not by interpolating
  3613.  between nearby data points;  also edge effects may produce unexpected and/or
  3614.  undesired results.  In some cases, small norm values produce a grid point
  3615.  reflecting the average of distant data points rather than a local average,
  3616.  while large values of norm may produce "steps" with several grid points
  3617.  having the same value as the closest data point, rather than making a smooth
  3618.  transition between adjacent data points.  Some areas of a grid may be filled
  3619.  by extrapolation, to an arbitrary boundary condition.  The variables are
  3620.  not normalized; consequently the units used for x and y will affect the
  3621.  relative weights of points in the x and y directions.)
  3622.  
  3623.  Examples:
  3624.        set dgrid3d 10,10,1     # defaults
  3625.        set dgrid3d ,,4
  3626.  
  3627.  The first specifies that a grid of size 10 by 10 is to be constructed using
  3628.  a norm value of 1 in the weight computation.  The second only modifies the
  3629.  norm, changing it to 4.
  3630.  
  3631.  
  3632. 
  3633. File: gnuplot.info, Node: dummy, Prev: dgrid3d, Up: set-show, Next: encoding
  3634.  
  3635.  The `set dummy` command changes the default dummy variable names.
  3636.  
  3637.  Syntax:
  3638.        set dummy {<dummy-var>} {,<dummy-var>}
  3639.        show dummy
  3640.  
  3641.  By default, `gnuplot` (*note gnuplot:: ) assumes that the independent, or
  3642.  "dummy", variable for the `plot` (*note plot:: ) command is "t" if in
  3643.  parametric or polar mode, or "x" otherwise. Similarly the independent
  3644.  variables for the `splot` (*note splot:: ) command are "u" and "v" in
  3645.  parametric mode (`splot` cannot be used in polar mode), or "x" and "y"
  3646.  otherwise.
  3647.  
  3648.  It may be more convenient to call a dummy variable by a more physically
  3649.  meaningful or conventional name.  For example, when plotting time functions:
  3650.  
  3651.        set dummy t
  3652.        plot sin(t), cos(t)
  3653.  
  3654.  At least one dummy variable must be set on the command; `set dummy` by itself
  3655.  will generate an error message.
  3656.  
  3657.  Examples:
  3658.        set dummy u,v
  3659.        set dummy ,s
  3660.  
  3661.  The second example sets the second variable to s.
  3662.  
  3663. 
  3664. File: gnuplot.info, Node: encoding, Prev: dummy, Up: set-show, Next: format
  3665.  
  3666.  The `set encoding` command selects a character encoding.  Valid values are
  3667.  `default`, which tells a terminal to use its default; `iso_8859_1` (known in
  3668.  the PostScript world as `ISO-Latin1`), which is used on many Unix workstations
  3669.  and with MS-Windows; `cp850`, for OS/2; and `cp437`, for MS-DOS.
  3670.  
  3671.  Syntax:
  3672.        set encoding {<value>}
  3673.        show encoding
  3674.  
  3675.  Note that encoding is not supported by all terminal drivers and that
  3676.  the device must be able to produce the desired non-standard characters.
  3677.  
  3678. 
  3679. File: gnuplot.info, Node: format, Prev: encoding, Up: set-show, Next: format specifiers
  3680.  
  3681.  The format of the tic-mark labels can be set with the `set format` command.
  3682.  
  3683.  Syntax:
  3684.        set format {<axes>} {"<format-string>"}
  3685.        set format {<axes>} {'<format-string>'}
  3686.        show format
  3687.  
  3688.  where <axes> is either `x`, `y`, `z`, `xy`, `x2`, `y2` or nothing (which is
  3689.  the same as `xy`).  The length of the string representing a tic mark (after
  3690.  formatting with 'printf') is restricted to 100 characters.  If the format
  3691.  string is omitted, the format will be returned to the default "%g".  For
  3692.  LaTeX users, the format "$%g$" is often desirable.  If the empty string "" is
  3693.  used, no label will be plotted with each tic, though the tic mark will still
  3694.  be plotted.  To eliminate all tic marks, use `set noxtics` (*note xtics:: ) or
  3695.   `set noytics` (*note ytics:: ).
  3696.  
  3697.  Newline (\n) is accepted in the format string.  Use double-quotes rather than
  3698.  single-quotes to enable such interpretation.  See also `syntax`
  3699.  (*note Syntax:: ).
  3700.  
  3701.  The default format for both axes is "%g", but other formats such as "%.2f" or
  3702.  "%3.0em" are often desirable.  Anything accepted by 'printf' when given a
  3703.  double precision number, and accepted by the terminal, will work.  Some other
  3704.  options have been added.  If the format string looks like a floating point
  3705.  format, then `gnuplot` (*note gnuplot:: ) tries to construct a reasonable
  3706.  format.
  3707.  
  3708.  Characters not preceded by "%" are printed verbatim.  Thus you can include
  3709.  spaces and labels in your format string, such as "%g m", which will put " m"
  3710.  after each number.  If you want "%" itself, double it: "%g %%".
  3711.  
  3712.  See also `set xtics` for more information about tic labels.
  3713.  
  3714. * Menu:
  3715.  
  3716. * format specifiers::
  3717. * time/date specifiers::
  3718.  
  3719. 
  3720. File: gnuplot.info, Node: format specifiers, Prev: format, Up: format, Next: time/date specifiers
  3721.  
  3722.  The acceptable formats (if not in time/date mode) are:
  3723.  
  3724.        Format       Explanation
  3725.        %f           floating point notation
  3726.        %e or %E     exponential notation; an "e" or "E" before the power
  3727.        %g or %G     the shorter of %e (or %E) and %f
  3728.        %x or %X     hex
  3729.        %o or %O     octal
  3730.        %t           mantissa to base 10
  3731.        %l           mantissa to base of current logscale
  3732.        %s           mantissa to base of current logscale; scientific power
  3733.        %T           power to base 10
  3734.        %L           power to base of current logscale
  3735.        %S           scientific power
  3736.        %c           character replacement for scientific power
  3737.        %P           multiple of pi
  3738.  
  3739.  A 'scientific' power is one such that the exponent is a multiple of three.
  3740.  Character replacement of scientific powers (`"%c"`) has been implemented
  3741.  for powers in the range -18 to +18.  For numbers outside of this range the
  3742.  format reverts to exponential.
  3743.  
  3744.  Other acceptable modifiers (which come after the "%" but before the format
  3745.  specifier) are "-", which left-justifies the number; "+", which forces all
  3746.  numbers to be explicitly signed; "#", which places a decimal point after
  3747.  floats that have only zeroes following the decimal point; a positive integer,
  3748.  which defines the field width; "0" (the digit, not the letter) immediately
  3749.  preceding the field width, which indicates that leading zeroes are to be used
  3750.  instead of leading blanks; and a decimal point followed by a non-negative
  3751.  integer, which defines the precision (the minimum number of digits of an
  3752.  integer, or the number of digits following the decimal point of a float).
  3753.  
  3754.  Some releases of 'printf' may not support all of these modifiers but may also
  3755.  support others; in case of doubt, check the appropriate documentation and
  3756.  then experiment.
  3757.  
  3758.  Examples:
  3759.        set format y "%t"; set ytics (5,10)          # "5.0" and "1.0"
  3760.        set format y "%s"; set ytics (500,1000)      # "500" and "1.0"
  3761.        set format y "+-12.3f"; set ytics(12345)     # "+12345.000  "
  3762.        set format y "%.2t*10^%+03T"; set ytic(12345)# "1.23*10^+04"
  3763.        set format y "%s*10^{%S}"; set ytic(12345)   # "12.345*10^{3}"
  3764.        set format y "%s %cg"; set ytic(12345)       # "12.345 kg"
  3765.        set format y "%.0P pi"; set ytic(6.283185)   # "2 pi"
  3766.        set format y "%.0P%%"; set ytic(50)          # "50%"
  3767.  
  3768.        set log y 2; set format y '%l'; set ytics (1,2,3)
  3769.        #displays "1.0", "1.0" and "1.5" (since 3 is 1.5 * 2^1)
  3770.  
  3771.  There are some problem cases that arise when numbers like 9.999 are printed
  3772.  with a format that requires both rounding and a power.
  3773.  
  3774.  If the data type for the axis is time/date, the format string must contain
  3775.  valid codes for the 'strftime' function (outside of `gnuplot`
  3776.  (*note gnuplot:: ), type "man strftime").  See `set timefmt`
  3777.  (*note timefmt:: ) for a list of the allowed input format codes.
  3778.  
  3779.  
  3780. 
  3781. File: gnuplot.info, Node: time/date specifiers, Prev: format specifiers, Up: format
  3782.  
  3783.  In time/date mode, the acceptable formats are:
  3784.  
  3785.        Format       Explanation
  3786.        %a           abbreviated name of day of the week
  3787.        %A           full name of day of the week
  3788.        %b or %h     abbreviated name of the month
  3789.        %B           full name of the month
  3790.        %d           day of the month, 1--31
  3791.        %D           shorthand for "%m/%d/%y"
  3792.        %H or %k     hour, 0--24
  3793.        %I or %l     hour, 0--12
  3794.        %j           day of the year, 1--366
  3795.        %m           month, 1--12
  3796.        %M           minute, 0--60
  3797.        %p           "am" or "pm"
  3798.        %r           shorthand for "%I:%M:%S %p"
  3799.        %R           shorthand for %H:%M"
  3800.        %S           second, 0--60
  3801.        %T           shorthand for "%H:%M:%S"
  3802.        %U           week of the year (week starts on Sunday)
  3803.        %w           day of the week, 0--6 (Sunday = 0)
  3804.        %W           week of the year (week starts on Monday)
  3805.        %y           year, 0-99
  3806.        %Y           year, 4-digit
  3807.  
  3808.  Except for the non-numerical formats, these may be preceded by a "0" ("zero",
  3809.  not "oh") to pad the field length with leading zeroes, and a positive digit,
  3810.  to define the minimum field width (which will be overridden if the specified
  3811.  width is not large enough to contain the number).  There is a 24-character
  3812.  limit to the length of the printed text; longer strings will be truncated.
  3813.  
  3814.  Examples:
  3815.  
  3816.  Suppose the text is "76/12/25 23:11:11".  Then
  3817.        set format x                 # defaults to "12/25/76" \n "23:11"
  3818.        set format x "%A, %d %b %Y"  # "Saturday, 25 Dec 1976"
  3819.        set format x "%r %d"         # "11:11:11 pm 12/25/76"
  3820.  
  3821.  Suppose the text is "98/07/06 05:04:03".  Then
  3822.        set format x "%1y/%2m/%3d %01H:%02M:%03S"  # "98/ 7/  6 5:04:003"
  3823.  
  3824. 
  3825. File: gnuplot.info, Node: function style, Prev: format, Up: set-show, Next: functions
  3826.  
  3827.  The `set function style` command changes the default plotting style for
  3828.  function plots.
  3829.  
  3830.  Syntax:
  3831.        set function style <style-choice>
  3832.        show function style
  3833.  
  3834.  See `set style` (*note style:: ) for the choices.  If no choice is given, the
  3835.  choices are listed.  `show function style` shows the current default function
  3836.  plotting style.
  3837.  
  3838.  
  3839. 
  3840. File: gnuplot.info, Node: functions, Prev: function style, Up: set-show, Next: grid
  3841.  
  3842.  The `show functions` command lists all user-defined functions and their
  3843.  definitions.
  3844.  
  3845.  Syntax:
  3846.        show functions
  3847.  
  3848.  For information about the definition and usage of functions in `gnuplot`
  3849.  (*note gnuplot:: ), please see `expressions` (*note Expressions:: ).
  3850.  
  3851.  
  3852. 
  3853. File: gnuplot.info, Node: grid, Prev: functions, Up: set-show, Next: hidden3d
  3854.  
  3855.  The `set grid` command allows grid lines to be drawn on the plot.
  3856.  
  3857.  Syntax:
  3858.        set grid {{no}{m}xtics} {{no}{m}ytics} {{no}{m}ztics}
  3859.                 {{no}{m}x2tics} {{no}{m}y2tics}
  3860.                 {polar {<angle>}}
  3861.                 { {linestyle <major_linestyle>}
  3862.                   | {linetype | lt <major_linetype>}
  3863.                     {linewidth | lw <major_linewidth>}
  3864.                   { , {linestyle | ls <minor_linestyle>}
  3865.                       | {linetype | lt <minor_linetype>}
  3866.                         {linewidth | lw <minor_linewidth>} } }
  3867.        set nogrid
  3868.        show grid
  3869.  
  3870.  The grid can be enabled and disabled for the major and/or minor tic
  3871.  marks on any axis, and the linetype and linewidth can be specified
  3872.  for major and minor grid lines, also via a predefined linestyle, as
  3873.  far as the active terminal driver supports this.
  3874.  
  3875.  Additionally, a polar grid can be selected for 2-d plots---circles are drawn
  3876.  to intersect the selected tics, and radial lines are drawn at definable
  3877.  intervals.  (The interval is given in degrees or radians ,depending on the
  3878.  `set angles` (*note angles:: ) setting.)  Note that a polar grid is no longer
  3879.  automatically generated in polar mode.
  3880.  
  3881.  The pertinent tics must be enabled before `set grid` can draw them; `gnuplot`
  3882.  (*note gnuplot:: ) will quietly ignore instructions to draw grid lines at
  3883.  non-existent tics, but they will appear if the tics are subsequently enabled.
  3884.  
  3885.  If no linetype is specified for the minor gridlines, the same linetype as the
  3886.  major gridlines is used.  The default polar angle is 30 degrees.
  3887.  
  3888.  By default, grid lines are drawn with half the usual linewidth. The major and
  3889.  minor linewidth specifiers scale this default value; for example, `set grid
  3890.  lw .5` will draw grid lines with one quarter the usual linewidth.
  3891.  
  3892.  Z grid lines are drawn on the back of the plot.  This looks better if a
  3893.  partial box is drawn around the plot---see `set border` (*note border:: ).
  3894.  
  3895.  
  3896. 
  3897. File: gnuplot.info, Node: hidden3d, Prev: grid, Up: set-show, Next: isosamples
  3898.  
  3899.  The `set hidden3d` command enables hidden line removal for surface plotting
  3900.  (see `splot` (*note splot:: )).  Some optional features of the underlying
  3901.  algorithm can also be controlled using this command.
  3902.  
  3903.  Syntax:
  3904.        set hidden3d {defaults} |
  3905.                     { {{offset <offset>} | {nooffset}}
  3906.                       {trianglepattern <bitpattern>}
  3907.                       {{undefined <level>} | {noundefined}}
  3908.                       {{no}altdiagonal}
  3909.                       {{no}bentover} }
  3910.        set nohidden3d
  3911.        show hidden3d
  3912.  
  3913.  In contrast to the usual display in gnuplot, hidden line removal actually
  3914.  treats the given function or data grids as real surfaces that can't be seen
  3915.  through, so parts behind the surface will be hidden by it.  For this to be
  3916.  possible, the surface needs to have 'grid structure' (see `splot datafile`
  3917.  (*note data-file:: ) about this), and it has to be drawn `with lines` or `with
  3918.  linespoints`.
  3919.  
  3920.  When `hidden3d` is set, both the hidden portion of the surface and possibly
  3921.  its contours drawn on the base (see `set contour` (*note contour:: )) as well
  3922.  as the grid will be hidden.  Each surface has its hidden parts removed with
  3923.  respect to itself and to other surfaces, if more than one surface is
  3924.  plotted.  Contours drawn on the surface (`set contour surface`) don't
  3925.  work.  Labels and arrows are always visible and are unaffected.  The key is
  3926.  also never hidden by the surface.
  3927.  
  3928.  Functions are evaluated at isoline intersections.  The algorithm interpolates
  3929.  linearly between function points or data points when determining the visible
  3930.  line segments.  This means that the appearance of a function may be different
  3931.  when plotted with `hidden3d` than when plotted with `nohidden3d` because in
  3932.  the latter case functions are evaluated at each sample.  Please see `set
  3933.  samples` and `set isosamples` (*note isosamples:: ) for discussion of the
  3934.  difference.
  3935.  
  3936.  The algorithm used to remove the hidden parts of the surfaces has some
  3937.  additional features controllable by this command.  Specifying `defaults` will
  3938.  set them all to their default settings, as detailed below.  If `defaults` is
  3939.  not given, only explicitly specified options will be influenced: all others
  3940.  will keep their previous values, so you can turn on/off hidden line removal
  3941.  via `set {no}hidden3d`, without modifying the set of options you chose.
  3942.  
  3943.  The first option, `offset`, influences the linestyle used for lines on the
  3944.  'back' side.  Normally, they are drawn in a linestyle one index number higher
  3945.  than the one used for the front, to make the two sides of the surface
  3946.  distinguishable.  You can specify a different line style offset to add
  3947.  instead of the default 1, by `offset <offset>`.  Option `nooffset` stands for
  3948.  `offset 0`, making the two sides of the surface use the same linestyle.
  3949.  
  3950.  Next comes the option `trianglepattern <bitpattern>`.  <bitpattern> must be
  3951.  a number between 0 and 7, interpreted as a bit pattern.  Each bit determines
  3952.  the visibility of one edge of the triangles each surface is split up into.
  3953.  Bit 0 is for the 'horizontal' edges of the grid, Bit 1 for the 'vertical'
  3954.  ones, and Bit 2 for the diagonals that split each cell of the original grid
  3955.  into two triangles.  The default pattern is 3, making all horizontal and
  3956.  vertical lines visible, but not the diagonals.  You may want to choose 7 to
  3957.  see those diagonals as well.
  3958.  
  3959.  The `undefined <level>` option lets you decide what the algorithm is to do
  3960.  with data points that are undefined (missing data, or undefined function
  3961.  values), or exceed the given x-, y- or z-ranges.  Such points can either be
  3962.  plotted nevertheless, or taken out of the input data set.  All surface
  3963.  elements touching a point that is taken out will be taken out as well, thus
  3964.  creating a hole in the surface.  If <level> = 3, equivalent to option
  3965.  `noundefined`, no points will be thrown away at all.  This may produce all
  3966.  kinds of problems elsewhere, so you should avoid this.  <level> = 2 will
  3967.  throw away undefined points, but keep the out-of-range ones.  <level> = 1,
  3968.  the default, will get rid of out-of-range points as well.
  3969.  
  3970.  By specifying `noaltdiagonal`, you can override the default handling of a
  3971.  special case can occur if `undefined` is active (i.e. <level> is not 3).
  3972.  Each cell of the grid-structured input surface will be divided in two
  3973.  triangles along one of its diagonals.  Normally, all these diagonals have
  3974.  the same orientation relative to the grid.  If exactly one of the four cell
  3975.  corners is excluded by the `undefined` handler, and this is on the usual
  3976.  diagonal, both triangles will be excluded.  However if the default setting
  3977.  of `altdiagonal` is active, the other diagonal will be chosen for this cell
  3978.  instead, minimizing the size of the hole in the surface.
  3979.  
  3980.  The `bentover` option controls what happens to another special case, this
  3981.  time in conjunction with the `trianglepattern`.  For rather crumply surfaces,
  3982.  it can happen that the two triangles a surface cell is divided into are seen
  3983.  from opposite sides (i.e. the original quadrangle is 'bent over'), as
  3984.  illustrated in the following ASCII art:
  3985.  
  3986.                                                                C----B
  3987.      original quadrangle:  A--B      displayed quadrangle:     |\   |
  3988.        ("set view 0,0")    | /|    ("set view 75,75" perhaps)  | \  |
  3989.                            |/ |                                |  \ |
  3990.                            C--D                                |   \|
  3991.                                                                A    D
  3992.  
  3993.  If the diagonal edges of the surface cells aren't generally made visible by
  3994.  bit 2 of the <bitpattern> there, the edge CB above wouldn't be drawn at all,
  3995.  normally, making the resulting display hard to understand.  Therefore, the
  3996.  default option of `bentover` will turn it visible in this case.  If you don't
  3997.  want that, you may choose `nobentover` instead.
  3998.  
  3999. 
  4000. File: gnuplot.info, Node: isosamples, Prev: hidden3d, Up: set-show, Next: key
  4001.  
  4002.  The isoline density (grid) for plotting functions as surfaces may be changed
  4003.  by the `set isosamples` command.
  4004.  
  4005.  Syntax:
  4006.        set isosamples <iso_1> {,<iso_2>}
  4007.        show isosamples
  4008.  
  4009.  Each function surface plot will have <iso_1> iso-u lines and <iso_2> iso-v
  4010.  lines.  If you only specify <iso_1>, <iso_2> will be set to the same value
  4011.  as <iso_1>.  By default, sampling is set to 10 isolines per u or v axis.
  4012.  A higher sampling rate will produce more accurate plots, but will take longer.
  4013.  These parameters have no effect on data file plotting.
  4014.  
  4015.  An isoline is a curve parameterized by one of the surface parameters while
  4016.  the other surface parameter is fixed.  Isolines provide a simple means to
  4017.  display a surface.  By fixing the u parameter of surface s(u,v), the iso-u
  4018.  lines of the form c(v) = s(u0,v) are produced, and by fixing the v parameter,
  4019.  the iso-v lines of the form c(u) = s(u,v0) are produced.
  4020.  
  4021.  When a function surface plot is being done without the removal of hidden
  4022.  lines, `set samples` (*note samples:: )  controls the number of points sampled
  4023.  along each isoline;  see `set samples` and `set hidden3d`
  4024.  (*note hidden3d:: ).  The contour algorithm assumes that a function sample
  4025.  occurs at each isoline intersection, so change in `samples` as well as
  4026.  `isosamples` may be desired when changing the resolution of a function
  4027.  surface/contour.
  4028.  
  4029.  
  4030. 
  4031. File: gnuplot.info, Node: key, Prev: isosamples, Up: set-show, Next: label
  4032.  
  4033.  The `set key` enables a key (or legend) describing plots on a plot.
  4034.  
  4035.  The contents of the key, i.e., the names given to each plotted data set and
  4036.  function and samples of the lines and/or symbols used to represent them, are
  4037.  determined by the `title` (*note title:: ) and  `with` (*note with:: ) options
  4038.  of the {s}s`}`plot` (*note plot:: ) command. Please see `plot title` and `plot
  4039.  with` for more information.
  4040.  
  4041.  Syntax:
  4042.        set key {  left | right | top | bottom | outside | below
  4043.                 | <position>}
  4044.                {Left | Right} {{no}reverse}
  4045.                {samplen <sample_length>} {spacing <vertical_spacing>}
  4046.                {width <width_increment>}
  4047.                {title "<text>"}
  4048.                {{no}box { {linestyle | ls <line_style>}
  4049.                           | {linetype | lt <line_type>}
  4050.                             {linewidth | lw <line_width>}}}
  4051.        set nokey
  4052.        show key
  4053.  
  4054.  By default the key is placed in the upper right corner of the graph.  The
  4055.  keywords `left`, `right`, `top`, `bottom`, `outside` and `below` may be used
  4056.  to place the key in the other corners inside the graph or to the right
  4057.  (outside) or below the graph.  They may be given alone or combined.
  4058.  
  4059.  Justification of the labels within the key is controlled by `Left` or `Right`
  4060.  (default is `Right`).  The text and sample can be reversed (`reverse`) and a
  4061.  box can be drawn around the key (`box {...}`) in a specified `linetype`
  4062.  and `linewidth` (*note linewidth:: ), or a user-defined  `linestyle`
  4063.  (*note linestyle:: ). Note that not all terminal drivers support linewidth
  4064.  selection, though.
  4065.  
  4066.  The length of the sample line can be controlled by `samplen`.  The sample
  4067.  length is computed as the sum of the tic length and <sample_length> times the
  4068.  character width.  `samplen` also affects the positions of point samples in
  4069.  the key since these are drawn at the midpoint of the sample line, even if it
  4070.  is not drawn.  <sample_length> must be an integer.
  4071.  
  4072.  The vertical spacing between lines is controlled by `spacing`.  The spacing
  4073.  is set equal to the product of the pointsize, the vertical tic size, and
  4074.  <vertical_spacing>.  The program will guarantee that the vertical spacing is
  4075.  no smaller than the character height.
  4076.  
  4077.  The <width_increment> is a number of character widths to be added to or
  4078.  subtracted from the length of the string.  This is useful only when you are
  4079.  putting a box around the key and you are using control characters in the text.
  4080.  `gnuplot` (*note gnuplot:: ) simply counts the number of characters in the
  4081.  string when computing the box width; this allows you to correct it.
  4082.  
  4083.  A title can be put on the key (`title "<text>"`)---see also `syntax`
  4084.  (*note Syntax:: ) for the distinction between text in single- or
  4085.  double-quotes.  The key title uses the same justification as do the plot
  4086.  titles.
  4087.  
  4088.  The defaults for `set key` are `right`, `top`, `Right`, `noreverse`, `samplen
  4089.  4`, `spacing 1.25`, `title ""`, and `nobox`.  The default <linetype> is the
  4090.  same as that used for the plot borders.  Entering `set key` with no options
  4091.  returns the key to its default configuration.
  4092.  
  4093.  The <position> can be a simple x,y,z as in previous versions, but these can
  4094.  be preceded by one of four keywords (`first`, `second`, `graph`, `screen`)
  4095.  which selects the coordinate system in which the position is specified.  See
  4096.  `coordinates` (*note Coordinates:: ) for more details.
  4097.  
  4098.  The key is drawn as a sequence of lines, with one plot described on each
  4099.  line.  On the right-hand side (or the left-hand side, if `reverse` is
  4100.  selected) of each line is a representation that attempts to mimic the way the
  4101.  curve is plotted.  On the other side of each line is the text description
  4102.  (the line title), obtained from the `plot` command.  The lines are vertically
  4103.  arranged so that an imaginary straight line divides the left- and right-hand
  4104.  sides of the key.  It is the coordinates of the top of this line that are
  4105.  specified with the `set key` command.  In a `plot`, only the x and y
  4106.  coordinates are used to specify the line position.  For a `splot`
  4107.  (*note splot:: ), x, y and z are all used as a 3-d location mapped using the
  4108.  same mapping as the graph itself to form the required 2-d screen position of
  4109.  the imaginary line.
  4110.  
  4111.  Some or all of the key may be outside of the graph boundary, although this
  4112.  may interfere with other labels and may cause an error on some devices.  If
  4113.  you use the keywords `outside` or `below`, `gnuplot` makes space for the keys
  4114.  and the graph becomes smaller.  Putting keys outside to the right, they
  4115.  occupy as few columns as possible, and putting them below, as many columns as
  4116.  possible (depending of the length of the labels), thus stealing as little
  4117.  space from the graph as possible.
  4118.  
  4119.  When using the TeX or PostScript drivers, or similar drivers where formatting
  4120.  information is embedded in the string, `gnuplot` is unable to calculate
  4121.  correctly the width of the string for key positioning.  If the key is to be
  4122.  positioned at the left, it may be convenient to use the combination  `set key
  4123.  left Left reverse`.  The box and gap in the grid will be the width of the
  4124.  literal string.
  4125.  
  4126.  If `splot` is being used to draw contours, the contour labels will be listed
  4127.  in the key.  If the alignment of these labels is poor or a different number
  4128.  of decimal places is desired, the label format can be specified.  See `set
  4129.  clabel` for details.
  4130.  
  4131.  Examples:
  4132.  
  4133.  This places the key at the default location:
  4134.        set key
  4135.  
  4136.  This disables the key:
  4137.        set nokey
  4138.  
  4139.  This places a key at coordinates 2,3.5,2 in the default (first) coordinate
  4140.  system:
  4141.        set key 2,3.5,2
  4142.  
  4143.  This places the key below the graph:
  4144.        set key below
  4145.  
  4146.  This places the key in the bottom left corner, left-justifies the text,
  4147.  gives it a title, and draws a box around it in linetype 3:
  4148.        set key left bottom Left title 'Legend' box 3
  4149.  
  4150. 
  4151. File: gnuplot.info, Node: label, Prev: key, Up: set-show, Next: linestyle
  4152.  
  4153.  Arbitrary labels can be placed on the plot using the `set label` command.
  4154.  
  4155.  Syntax:
  4156.        set label {<tag>} {"<label_text>"} {at <position>}
  4157.                  {<justification>} {{no}rotate} {font "<name><,size>"}
  4158.        set nolabel {<tag>}
  4159.        show label
  4160.  
  4161.  The <position> is specified by either x,y or x,y,z, and may be preceded by
  4162.  `first`, `second`, `graph`, or `screen` to select the coordinate system.
  4163.  See `coordinates` (*note Coordinates:: ) for details.
  4164.  
  4165.  The tag is an integer that is used to identify the label. If no <tag> is
  4166.  given, the lowest unused tag value is assigned automatically.  The tag can be
  4167.  used to delete or modify a specific label.  To change any attribute of an
  4168.  existing label, use the `set label` command with the appropriate tag, and
  4169.  specify the parts of the label to be changed.
  4170.  
  4171.  By default, the text is placed flush left against the point x,y,z.  To adjust
  4172.  the way the label is positioned with respect to the point x,y,z, add the
  4173.  parameter <justification>, which may be `left`, `right` or `center`,
  4174.  indicating that the point is to be at the left, right or center of the text.
  4175.  Labels outside the plotted boundaries are permitted but may interfere with
  4176.  axis labels or other text.
  4177.  
  4178.  If `rotate` (*note rotate:: ) is given, the label is written vertically (if
  4179.  the terminal can do so, of course).
  4180.  
  4181.  If one (or more) axis is timeseries, the appropriate coordinate should be
  4182.  given as a quoted time string according to the `timefmt` (*note timefmt:: )
  4183.  format string.  See `set xdata` (*note xdata:: ) and set timefmt.
  4184.  
  4185.  The EEPIC, Imagen, LaTeX, and TPIC drivers allow \\ in a string to specify
  4186.  a newline.
  4187.  
  4188.  Examples:
  4189.  
  4190.  To set a label at (1,2) to "y=x", use:
  4191.        set label "y=x" at 1,2
  4192.  
  4193.  To set a Sigma of size 24, from the Symbol font set, at the center of
  4194.  the graph, use:
  4195.        set label "S" at graph 0.5,0.5 center font "Symbol,24"
  4196.  
  4197.  To set a label "y=x^2" with the right of the text at (2,3,4), and tag the
  4198.  label as number 3, use:
  4199.        set label 3 "y=x^2" at 2,3,4 right
  4200.  
  4201.  To change the preceding label to center justification, use:
  4202.        set label 3 center
  4203.  
  4204.  To delete label number 2, use:
  4205.        set nolabel 2
  4206.  
  4207.  To delete all labels, use:
  4208.        set nolabel
  4209.  
  4210.  To show all labels (in tag order), use:
  4211.        show label
  4212.  
  4213.  To set a label on a graph with a timeseries on the x axis, use, for example:
  4214.        set timefmt "%d/%m/%y,%H:%M"
  4215.        set label "Harvest" at "25/8/93",1
  4216.  
  4217. 
  4218. File: gnuplot.info, Node: linestyle, Prev: label, Up: set-show, Next: lmargin
  4219.  
  4220.  Each terminal has a default set of line and point types, which can be seen
  4221.  by using the command `test` (*note test:: ).  set linestyle defines a set of
  4222.  line types and widths and point types and sizes so that you can refer to them
  4223.  later by an index instead of repeating all the information at each
  4224.  invocation.
  4225.  
  4226.  Syntax:
  4227.        set linestyle <index> {linetype | lt <line_type>}
  4228.                              {linewidth | lw <line_width>}
  4229.                              {pointtype | pt <point_type>}
  4230.                              {pointsize | ps <point_size>}
  4231.        set nolinestyle
  4232.        show linestyle
  4233.  
  4234.  The line and point types are taken from the default types for the terminal
  4235.  currently in use.  The line width and point size are multipliers for the
  4236.  default width and size (but note that <point_size> here is unaffected by
  4237.  the multiplier given on 'set pointsize').
  4238.  
  4239.  The defaults for the line and point types is the index.  The defaults for
  4240.  the width and size are both unity.
  4241.  
  4242.  Linestyles created by this mechanism do not replace the default styles;
  4243.  both may be used.
  4244.  
  4245.  Not all terminals support the `linewidth` (*note linewidth:: ) and
  4246.   `pointsize` (*note pointsize:: ) features; if not supported, the option will
  4247.  be ignored.
  4248.  
  4249.  Note that this feature is not completely implemented; linestyles defined by
  4250.  this mechanism may be used with 'plot', 'splot', 'replot', and 'set arrow',
  4251.  but not by other commands that allow the default index to be used, such as
  4252.  'set grid'.
  4253.  
  4254.  Example:
  4255.  Suppose that the default lines for indices 1, 2, and 3 are red, green, and
  4256.  blue, respectively, and the default point shapes for the same indices are a
  4257.  square, a cross, and a triangle, respectively.  Then
  4258.  
  4259.        set linestyle 1 lt 2 lw 2 pt 3 ps 0.5
  4260.  
  4261.  defines a new linestyle that is green and twice the default width and a new
  4262.  pointstyle that is a half-sized triangle.  The commands
  4263.  
  4264.        set function style lines
  4265.        plot f(x) lt 3, g(x) ls 1
  4266.  
  4267.  will create a plot of f(x) using the default blue line and a plot of g(x)
  4268.  using the user-defined wide green line.  Similarly the commands
  4269.  
  4270.        set function style linespoints
  4271.        plot p(x) lt 1 pt 3, q(x) ls 1
  4272.  
  4273.  will create a plot of f(x) using the default triangles connected by a red
  4274.  line and q(x) using small triangles connected by a green line.
  4275.  
  4276. 
  4277. File: gnuplot.info, Node: lmargin, Prev: linestyle, Up: set-show, Next: locale
  4278.  
  4279.  The command `set lmargin` sets the size of the left margin.  Please see
  4280.  `set margin` (*note margin:: ) for details.
  4281.  
  4282.  
  4283. 
  4284. File: gnuplot.info, Node: locale, Prev: lmargin, Up: set-show, Next: logscale
  4285.  
  4286.  The `locale` setting determines the language with which `{x,y,z}{d,m}tics`
  4287.  will write the days and months.
  4288.  
  4289.  Syntax:
  4290.        set locale {"<locale>"}
  4291.  
  4292.  <locale> may be any language designation acceptable to your installation.
  4293.  See your system documentation for the available options.  The default value
  4294.  is determined from the LANG environment variable.
  4295.  
  4296. 
  4297. File: gnuplot.info, Node: logscale, Prev: locale, Up: set-show, Next: mapping
  4298.  
  4299.  Log scaling may be set on the x, y, z, x2 and/or y2 axes.
  4300.  
  4301.  Syntax:
  4302.        set logscale <axes> <base>
  4303.        set nologscale <axes>
  4304.        show logscale
  4305.  
  4306.  where <axes> may be any combinations of `x`, `y`, and `z`, in any order, or
  4307.  `x2` or `y2` and where <base> is the base of the log scaling.  If <base> is
  4308.  not given, then 10 is assumed.  If <axes> is not given, then all axes are
  4309.  assumed.  `set nologscale` turns off log scaling for the specified axes.
  4310.  
  4311.  Examples:
  4312.  
  4313.  To enable log scaling in both x and z axes:
  4314.        set logscale xz
  4315.  
  4316.  To enable scaling log base 2 of the y axis:
  4317.        set logscale y 2
  4318.  
  4319.  To disable z axis log scaling:
  4320.        set nologscale z
  4321.  
  4322. 
  4323. File: gnuplot.info, Node: mapping, Prev: logscale, Up: set-show, Next: margin
  4324.  
  4325.  If data are provided to `splot` (*note splot:: ) in spherical or cylindrical
  4326.  coordinates, the `set mapping` command should be used to instruct `gnuplot`
  4327.  (*note gnuplot:: ) how to interpret them.
  4328.  
  4329.  Syntax:
  4330.        set mapping {cartesian | spherical | cylindrical}
  4331.  
  4332.  A cartesian coordinate system is used by default.
  4333.  
  4334.  For a spherical coordinate system, the data occupy two or three columns (or
  4335.  `using` (*note using:: ) entries).  The first two are interpreted as the polar
  4336.  and azimuthal angles theta and phi (in the units specified by `set angles`
  4337.  (*note angles:: )).  The radius r is taken from the third column if there is
  4338.  one, or is set to unity if there is no third column.  The mapping is:
  4339.  
  4340.        x = r * cos(theta) * cos(phi)
  4341.        y = r * sin(theta) * cos(phi)
  4342.        z = r * sin(phi)
  4343.  
  4344.  Note that this is a "geographic" spherical system, rather than a "polar" one.
  4345.  
  4346.  For a cylindrical coordinate system, the data again occupy two or three
  4347.  columns.  The first two are interpreted as theta (in the units specified by
  4348.  `set angles`) and z.  The radius is either taken from the third column or set
  4349.  to unity, as in the spherical case.  The mapping is:
  4350.  
  4351.        x = r * cos(theta)
  4352.        y = r * sin(theta)
  4353.        z = z
  4354.  
  4355.  The effects of `mapping` can be duplicated with the `using` filter on the
  4356.  `splot` command, but `mapping` may be more convenient if many data files are
  4357.  to be processed.  However even if `mapping` is used, `using` may still be
  4358.  necessary if the data in the file are not in the required order.
  4359.  
  4360.  `mapping` has no effect on `plot` (*note plot:: ).
  4361.  
  4362.  
  4363. 
  4364. File: gnuplot.info, Node: margin, Prev: mapping, Up: set-show, Next: missing
  4365.  
  4366.  The computed margins can be overridden by the `set margin` commands.  `show
  4367.  margin` shows the current settings.
  4368.  
  4369.  Syntax:
  4370.        set bmargin {<margin>}
  4371.        set lmargin {<margin>}
  4372.        set rmargin {<margin>}
  4373.        set tmargin {<margin>}
  4374.        show margin
  4375.  
  4376.  The units of <margin> are character heights or widths, as appropriate.  A
  4377.  positive value defines the absolute size of the margin.  A negative value
  4378.  (or none) causes `gnuplot` (*note gnuplot:: ) to revert to the computed
  4379.  value.
  4380.  
  4381.  Normally the margins of a plot are automatically calculated based on tics,
  4382.  tic labels, axis labels, the plot title, the timestamp and the size of the
  4383.  key if it is outside the borders.  If, however, tics are attached to the
  4384.  axes (`set xtics axis`, for example), neither the tics themselves nor their
  4385.  labels will be included in either the margin calculation or the calculation
  4386.  of the positions of other text to be written in the margin.  This can lead
  4387.  to tic labels overwriting other text if the axis is very close to the border.
  4388.  
  4389. 
  4390. File: gnuplot.info, Node: missing, Prev: margin, Up: set-show, Next: multiplot
  4391.  
  4392.  The `set missing` command allows you to tell `gnuplot` (*note gnuplot:: ) what
  4393.  character is used in a data file to denote missing data.
  4394.  
  4395.  Syntax:
  4396.        set missing {"<character>"}
  4397.        show missing
  4398.  
  4399.  Example:
  4400.        set missing "?"
  4401.  
  4402.  would mean that, when plotting a file containing
  4403.  
  4404.           1 1
  4405.           2 ?
  4406.           3 2
  4407.  
  4408.  the middle line would be ignored.
  4409.  
  4410.  There is no default character for `missing`.
  4411.  
  4412. 
  4413. File: gnuplot.info, Node: multiplot, Prev: missing, Up: set-show, Next: mx2tics
  4414.  
  4415.  The command `set multiplot` places `gnuplot` (*note gnuplot:: ) in the
  4416.  multiplot mode, in which several plots are placed on the same page, window, or
  4417.  screen.
  4418.  
  4419.  Syntax:
  4420.        set multiplot
  4421.        set nomultiplot
  4422.  
  4423.  For some terminals, no plot is displayed until the command `set nomultiplot`
  4424.  is given, which causes the entire page to be drawn and then returns `gnuplot`
  4425.  to its normal single-plot mode.  For other terminals, each separate `plot`
  4426.  (*note plot:: ) command produces a plot, but the screen may not be cleared
  4427.  between plots.
  4428.  
  4429.  Any labels or arrows that have been defined will be drawn for each plot
  4430.  according to the current size and origin (unless their coordinates are
  4431.  defined in the `screen` system).  Just about everything else that can be
  4432.  `set` (*note set-show:: ) is applied to each plot, too.  If you want something
  4433.  to appear only once on the page, for instance a single time stamp, you'll need
  4434.  to put a `set time`/`set notime` pair around one of the `plot`, `splot`
  4435.  (*note splot:: ) or  `replot` (*note replot:: ) commands within the `set
  4436.  multiplot`/`set nomultiplot` block.
  4437.  
  4438.  The commands `set origin` (*note origin:: ) and  `set size` (*note size:: )
  4439.  must be used to correctly position each plot; see `set origin` and `set size`
  4440.  for details of their usage.
  4441.  
  4442.  Example:
  4443.        set size 0.7,0.7
  4444.        set origin 0.1,0.1
  4445.        set multiplot
  4446.        set size 0.4,0.4
  4447.        set origin 0.1,0.1
  4448.        plot sin(x)
  4449.        set size 0.2,0.2
  4450.        set origin 0.5,0.5
  4451.        plot cos(x)
  4452.        set nomultiplot
  4453.  
  4454.  displays a plot of cos(x) stacked above a plot of sin(x).  Note the initial
  4455.  `set size` and `set origin`.  While these are not always required, their
  4456.  inclusion is recommended.  Some terminal drivers require that bounding box
  4457.  information be available before any plots can be made, and the form given
  4458.  above guarantees that the bounding box will include the entire plot array
  4459.  rather than just the bounding box of the first plot.
  4460.  
  4461.  `set size` and `set origin` refer to the entire plotting area used for each
  4462.  plot.  If you want to have the axes themselves line up, you can guarantee
  4463.  that the margins are the same size with the `set margin` (*note margin:: )
  4464.  commands.  See `set margin` for their use.  Note that the margin settings are
  4465.  absolute, in character units, so the appearance of the graph in the remaining
  4466.  space will depend on the screen size of the display device, e.g., perhaps
  4467.  quite different on a video display and a printer.
  4468.  
  4469.  
  4470. 
  4471. File: gnuplot.info, Node: mx2tics, Prev: multiplot, Up: set-show, Next: mxtics
  4472.  
  4473.  Minor tic marks along the x2 (top) axis are controlled by `set mx2tics`.
  4474.  Please see `set mxtics` (*note mxtics:: ).
  4475.  
  4476.  
  4477. 
  4478. File: gnuplot.info, Node: mxtics, Prev: mx2tics, Up: set-show, Next: my2tics
  4479.  
  4480.  Minor tic marks along the x axis are controlled by `set mxtics`.  They can be
  4481.  turned off with `set nomxtics`.  Similar commands control minor tics along
  4482.  the other axes.
  4483.  
  4484.  Syntax:
  4485.        set mxtics {<freq> | default}
  4486.        set nomxtics
  4487.        show mxtics
  4488.  
  4489.  The same syntax applies to `mytics` (*note mytics:: ),  `mztics`
  4490.  (*note mztics:: ),  `mx2tics` (*note mx2tics:: ) and  `my2tics`
  4491.  (*note my2tics:: ).
  4492.  
  4493.  <freq> is the number of sub-intervals (NOT the number of minor tics) between
  4494.  major tics (ten is the default for a linear axis, so there are nine minor
  4495.  tics between major tics). Selecting `default` will return the number of minor
  4496.  ticks to its default value.
  4497.  
  4498.  If the axis is logarithmic, the number of sub-intervals will be set to a
  4499.  reasonable number by default (based upon the length of a decade).  This will
  4500.  be overridden if <freq> is given.  However the usual minor tics (2, 3, ...,
  4501.  8, 9 between 1 and 10, for example) are obtained by setting <freq> to 10,
  4502.  even though there are but nine sub-intervals.
  4503.  
  4504.  Minor tics can be used only with uniformly spaced major tics.  Since major
  4505.  tics can be placed arbitrarily by `set {x|x2|y|y2|z}tics`, minor tics cannot
  4506.  be used if major tics are explicitly `set` (*note set-show:: ).
  4507.  
  4508.  By default, minor tics are off for linear axes and on for logarithmic axes.
  4509.  They inherit the settings for `axis|border` and `{no}mirror` specified for
  4510.  the major tics.  Please see `set xtics` (*note xtics:: ) for information about
  4511.  these.
  4512.  
  4513.  
  4514. 
  4515. File: gnuplot.info, Node: my2tics, Prev: mxtics, Up: set-show, Next: mytics
  4516.  
  4517.  Minor tic marks along the y2 (right-hand) axis are controlled by `set
  4518.  my2tics`.  Please see `set mxtics` (*note mxtics:: ).
  4519.  
  4520.  
  4521. 
  4522. File: gnuplot.info, Node: mytics, Prev: my2tics, Up: set-show, Next: mztics
  4523.  
  4524.  Minor tic marks along the y axis are controlled by `set mytics`.  Please
  4525.  see `set mxtics` (*note mxtics:: ).
  4526.  
  4527.  
  4528. 
  4529. File: gnuplot.info, Node: mztics, Prev: mytics, Up: set-show, Next: offsets
  4530.  
  4531.  Minor tic marks along the z axis are controlled by `set mztics`.  Please
  4532.  see `set mxtics` (*note mxtics:: ).
  4533.  
  4534.  
  4535. 
  4536. File: gnuplot.info, Node: offsets, Prev: mztics, Up: set-show, Next: origin
  4537.  
  4538.  Offsets provide a mechanism to put a boundary around the data inside of an
  4539.  autoscaled graph.
  4540.  
  4541.  Syntax:
  4542.        set offsets <left>, <right>, <top>, <bottom>
  4543.        set nooffsets
  4544.        show offsets
  4545.  
  4546.  Each offset may be a constant or an expression.  Each defaults to 0.  Left
  4547.  and right offsets are given in units of the x axis, top and bottom offsets in
  4548.  units of the y axis.  A positive offset expands the graph in the specified
  4549.  direction, e.g., a positive bottom offset makes ymin more negative.  Negative
  4550.  offsets, while permitted, can have unexpected interactions with autoscaling
  4551.  and clipping.
  4552.  
  4553.  Offsets are ignored in `splot`s (*note splot:: ).
  4554.  
  4555.  Example:
  4556.        set offsets 0, 0, 2, 2
  4557.        plot sin(x)
  4558.  
  4559.  This graph of sin(x) will have a y range [-3:3] because the function
  4560.  will be autoscaled to [-1:1] and the vertical offsets are each two.
  4561.  
  4562. 
  4563. File: gnuplot.info, Node: origin, Prev: offsets, Up: set-show, Next: output
  4564.  
  4565.  The `set origin` command is used to specify the origin of a plotting surface
  4566.  (i.e., the graph and its margins) on the screen.  The coordinates are given
  4567.  in the `screen` coordinate system (see `coordinates` (*note Coordinates:: )
  4568.  for information about this system).
  4569.  
  4570.  Syntax:
  4571.        set origin <x-origin>,<y-origin>
  4572.  
  4573. 
  4574. File: gnuplot.info, Node: output, Prev: origin, Up: set-show, Next: parametric
  4575.  
  4576.  By default, screens are displayed to the standard output. The `set output`
  4577.  command redirects the display to the specified file or device.
  4578.  
  4579.  Syntax:
  4580.        set output {"<filename>"}
  4581.        show output
  4582.  
  4583.  The filename must be enclosed in quotes.  If the filename is omitted, any
  4584.  output file opened by a previous invocation of `set output` will be closed
  4585.  and new output will be sent to STDOUT.  (If you give the command `set output
  4586.  "STDOUT"`, your output may be sent to a file named "STDOUT"!  ["May be", not
  4587.  "will be", because some terminals, like `x11` (*note x11:: ), ignore set
  4588.  output.])
  4589.  
  4590.  MSDOS users should note that the \ character has special significance in
  4591.  double-quoted strings, so single-quotes should be used for filenames in
  4592.  different directories.
  4593.  
  4594.  When both `set terminal` (*note terminal:: ) and set output are used together,
  4595.  it is safest to give `set terminal` first, because some terminals set a flag
  4596.  which is needed in some operating systems.  This would be the case, for
  4597.  example, if the operating system needs to know whether or not a file is to be
  4598.  formatted in order to open it properly.
  4599.  
  4600.  On machines with popen functions (Unix), output can be piped through a shell
  4601.  command if the first non-whitespace character of the filename is '|'.
  4602.  For instance,
  4603.  
  4604.        set output "|lpr -Plaser filename"
  4605.        set output "|lp -dlaser filename"
  4606.  
  4607.  On MSDOS machines, `set output "PRN"` will direct the output to the default
  4608.  printer.  On VMS, output can be sent directly to any spooled device.  It is
  4609.  also possible to send the output to DECnet transparent tasks, which allows
  4610.  some flexibility.
  4611.  
  4612. 
  4613. File: gnuplot.info, Node: parametric, Prev: output, Up: set-show, Next: pointsize
  4614.  
  4615.  The `set parametric` command changes the meaning of `plot` (*note plot:: )
  4616.  ((`splot` (*note splot:: )) from normal functions to parametric
  4617.  functions.  The command `set noparametric` restores the plotting style to
  4618.  normal, single-valued expression plotting.
  4619.  
  4620.  Syntax:
  4621.        set parametric
  4622.        set noparametric
  4623.        show parametric
  4624.  
  4625.  For 2-d plotting, a parametric function is determined by a pair of parametric
  4626.  functions operating on a parameter.  An example of a 2-d parametric function
  4627.  would be `plot sin(t),cos(t)`, which draws a circle (if the aspect ratio is
  4628.  set correctly---see `set size` (*note size:: )).   `gnuplot`
  4629.  (*note gnuplot:: ) will display an error message if both functions are not
  4630.  provided for a parametric `plot`.
  4631.  
  4632.  For 3-d plotting, the surface is described as x=f(u,v), y=g(u,v), z=h(u,v).
  4633.  Therefore a triplet of functions is required.  An example of a 3-d parametric
  4634.  function would be `cos(u)*cos(v),cos(u)*sin(v),sin(u)`, which draws a sphere.
  4635.  `gnuplot` will display an error message if all three functions are not
  4636.  provided for a parametric `splot`.
  4637.  
  4638.  The total set of possible plots is a superset of the simple f(x) style plots,
  4639.  since the two functions can describe the x and y values to be computed
  4640.  separately.  In fact, plots of the type t,f(t) are equivalent to those
  4641.  produced with f(x) because the x values are computed using the identity
  4642.  function.  Similarly, 3-d plots of the type u,v,f(u,v) are equivalent to
  4643.  f(x,y).
  4644.  
  4645.  Note that the order the parametric functions are specified is xfunction,
  4646.  yfunction (and zfunction) and that each operates over the common parametric
  4647.  domain.
  4648.  
  4649.  Also, the `set parametric` function implies a new range of values.  Whereas
  4650.  the normal f(x) and f(x,y) style plotting assume an xrange and yrange (and
  4651.  zrange), the parametric mode additionally specifies a trange, urange, and
  4652.  vrange.  These ranges may be set directly with `set trange` (*note trange:: ),
  4653.   `set urange` (*note urange:: ), and `set vrange` (*note vrange:: ), or by
  4654.  specifying the range on the plot or splot commands.  Currently the default
  4655.  range for these parametric variables is [-5:5].  Setting the ranges to
  4656.  something more meaningful is expected.
  4657.  
  4658.  
  4659. 
  4660. File: gnuplot.info, Node: pointsize, Prev: parametric, Up: set-show, Next: polar
  4661.  
  4662.  The `set pointsize` command scales the size of the points used in plots.
  4663.  
  4664.  Syntax:
  4665.        set pointsize <multiplier>
  4666.        show pointsize
  4667.  
  4668.  The default is a multiplier of 1.0.  Larger pointsizes may be useful to
  4669.  make points more visible in bitmapped graphics.
  4670.  
  4671.  The pointsize of a single plot may be changed on the `plot` (*note plot:: )
  4672.  command.  See `plot with` (*note with:: ) for details.
  4673.  
  4674.  Please note that the pointsize setting is not supported by all terminal
  4675.  types.
  4676.  
  4677. 
  4678. File: gnuplot.info, Node: polar, Prev: pointsize, Up: set-show, Next: rmargin
  4679.  
  4680.  The `set polar` command changes the meaning of the plot from rectangular
  4681.  coordinates to polar coordinates.
  4682.  
  4683.  Syntax:
  4684.        set polar
  4685.        set nopolar
  4686.        show polar
  4687.  
  4688.  There have been changes made to polar mode in version 3.7, so that scripts
  4689.  for `gnuplot` (*note gnuplot:: ) versions 3.5 and earlier will require
  4690.  modification.  The main change is that the dummy variable t is used for the
  4691.  angle so that the x and y ranges can be controlled independently.  Other
  4692.  changes are: 1) tics are no longer put along the zero axes automatically
  4693.  ---use `set xtics axis nomirror`; `set ytics axis nomirror`; 2) the grid, if
  4694.  selected, is not automatically polar ---use `set grid polar`; 3) the grid is
  4695.  not labelled with angles ---use `set label` (*note label:: ) as necessary.
  4696.  
  4697.  In polar coordinates, the dummy variable (t) is an angle.  The default range
  4698.  of t is [0:2*pi], or, if degree units have been selected, to [0:360] (see
  4699.  `set angles` (*note angles:: )).
  4700.  
  4701.  The command `set nopolar` changes the meaning of the plot back to the default
  4702.  rectangular coordinate system.
  4703.  
  4704.  The `set polar` command is not supported for `splot`s (*note splot:: ).  See
  4705.  the  `set mapping` (*note mapping:: ) command for similar functionality for
  4706.  `splot`s.
  4707.  
  4708.  While in polar coordinates the meaning of an expression in t is really
  4709.  r = f(t), where t is an angle of rotation.  The trange controls the domain
  4710.  (the angle) of the function, and the x and y ranges control the range of the
  4711.  graph in the x and y directions.  Each of these ranges, as well as the
  4712.  rrange, may be autoscaled or set explicitly.  See `set xrange`
  4713.  (*note xrange:: ) for details of all the `set range` commands.
  4714.  
  4715.  Example:
  4716.        set polar
  4717.        plot t*sin(t)
  4718.        plot [-2*pi:2*pi] [-3:3] [-3:3] t*sin(t)
  4719.  
  4720.  The first `plot` (*note plot:: ) uses the default polar angular domain of 0 to
  4721.  2*pi.  The radius and the size of the graph are scaled automatically.  The
  4722.  second `plot` expands the domain, and restricts the size of the graph to
  4723.  [-3:3] in both directions.
  4724.  
  4725.  You may want to `set size square` to have `gnuplot` try to make the aspect
  4726.  ratio equal to unity, so that circles look circular.
  4727.  
  4728. 
  4729. File: gnuplot.info, Node: rmargin, Prev: polar, Up: set-show, Next: rrange
  4730.  
  4731.  The command `set rmargin` sets the size of the right margin.  Please see
  4732.  `set margin` (*note margin:: ) for details.
  4733.  
  4734.  
  4735. 
  4736. File: gnuplot.info, Node: rrange, Prev: rmargin, Up: set-show, Next: samples
  4737.  
  4738.  The `set rrange` command sets the range of the radial coordinate for a
  4739.  graph in polar mode.  Please see `set xrange` (*note xrange:: ) for details.
  4740.  
  4741.  
  4742. 
  4743. File: gnuplot.info, Node: samples, Prev: rrange, Up: set-show, Next: size
  4744.  
  4745.  The sampling rate of functions, or for interpolating data, may be changed
  4746.  by the `set samples` command.
  4747.  
  4748.  Syntax:
  4749.        set samples <samples_1> {,<samples_2>}
  4750.        show samples
  4751.  
  4752.  By default, sampling is set to 100 points.  A higher sampling rate will
  4753.  produce more accurate plots, but will take longer.  This parameter has no
  4754.  effect on data file plotting unless one of the interpolation/approximation
  4755.  options is used.  See `plot smooth` (*note smooth:: ) re 2-d data and  `set
  4756.  cntrparam` (*note cntrparam:: ) and `set dgrid3d` (*note dgrid3d:: ) re 3-d
  4757.  data.
  4758.  
  4759.  When a 2-d graph is being done, only the value of <samples_1> is relevant.
  4760.  
  4761.  When a surface plot is being done without the removal of hidden lines, the
  4762.  value of samples specifies the number of samples that are to be evaluated for
  4763.  the isolines.  Each iso-v line will have <sample_1> samples and each iso-u
  4764.  line will have <sample_2> samples.  If you only specify <samples_1>,
  4765.  <samples_2> will be set to the same value as <samples_1>.  See also `set
  4766.  isosamples`.
  4767.  
  4768. 
  4769. File: gnuplot.info, Node: size, Prev: samples, Up: set-show, Next: style
  4770.  
  4771.  The `set size` command scales the displayed size of the plot.
  4772.  
  4773.  Syntax:
  4774.        set size {{no}square | ratio <r> | noratio} {<xscale>,<yscale>}
  4775.        show size
  4776.  
  4777.  The <xscale> and <yscale> values are the scaling factors for the size of the
  4778.  plot, which includes the graph and the margins.
  4779.  
  4780.  `ratio` causes `gnuplot` (*note gnuplot:: ) to try to create a graph with an
  4781.  aspect ratio of <r> (the ratio of the y-axis length to the x-axis length)
  4782.  within the portion of the plot specified by <xscale> and <yscale>.
  4783.  
  4784.  The meaning of a negative value for <r> is different.  If <r>=-1, gnuplot
  4785.  tries to set the scales so that the unit has the same length on both the x
  4786.  and y axes (suitable for geographical data, for instance).  If <r>=-2, the
  4787.  unit on y has twice the length of the unit on x, and so on.
  4788.  
  4789.  The success of `gnuplot` in producing the requested aspect ratio depends on
  4790.  the terminal selected.  The graph area will be the largest rectangle of
  4791.  aspect ratio <r> that will fit into the specified portion of the output
  4792.  (leaving adequate margins, of course).
  4793.  
  4794.  `square` is a synonym for `ratio 1`.
  4795.  
  4796.  Both `noratio` and `nosquare` return the graph to the default aspect ratio
  4797.  of the terminal, but do not return <xscale> or <yscale> to their default
  4798.  values (1.0).
  4799.  
  4800.  `ratio` and `square` have no effect on 3-d plots.
  4801.  
  4802.  `set size` is relative to the default size, which differs from terminal to
  4803.  terminal.  Since `gnuplot` fills as much of the available plotting area as
  4804.  possible by default, it is safer to use `set size` to decrease the size of
  4805.  a plot than to increase it.  See `set terminal` (*note terminal:: ) for the
  4806.  default sizes.
  4807.  
  4808.  On some terminals, changing the size of the plot will result in text being
  4809.  misplaced.
  4810.  
  4811.  Examples:
  4812.  
  4813.  To set the size to normal size use:
  4814.        set size 1,1
  4815.  
  4816.  To make the graph half size and square use:
  4817.        set size square 0.5,0.5
  4818.  
  4819.  To make the graph twice as high as wide use:
  4820.        set size ratio 2
  4821.  
  4822.  
  4823. 
  4824. File: gnuplot.info, Node: style, Prev: size, Up: set-show, Next: boxerrorbars
  4825.  
  4826.  Default styles are chosen with the `set function style`
  4827.  (*note function style:: ) and  `set data style` (*note data style:: )
  4828.  commands.  See `plot with` (*note with:: ) for information about how to
  4829.  override the default plotting style for individual functions and data sets.
  4830.  
  4831.  Syntax:
  4832.        set function style <style>
  4833.        set data style <style>
  4834.        show function style
  4835.        show data style
  4836.  
  4837.  The types used for all line and point styles (i.e., solid, dash-dot, color,
  4838.  etc. for lines; circles, squares, crosses, etc. for points) will be either
  4839.  those specified on the `plot` (*note plot:: ) or  `splot` (*note splot:: )
  4840.  command or will be chosen sequentially from the types available to the
  4841.  terminal in use.  Use the command `test` (*note test:: ) to see what is
  4842.  available.
  4843.  
  4844.  None of the styles requiring more than two columns of information (e.g.,
  4845.  `errorbars` (*note errorbars:: )) can be used with splots or function
  4846.  plots.  Neither ther `boxes` (*note boxes:: ) nor any of the `steps`
  4847.  (*note steps:: ) styles can be used with splots.  If an inappropriate style is
  4848.  specified, it will be changed to `points` (*note points:: ).
  4849.  
  4850.  For 2-d data with more than two columns, `gnuplot` (*note gnuplot:: ) is picky
  4851.  about the allowed `errorbar` styles.  The `using` (*note using:: ) option on
  4852.  the plot command can be used to set up the correct columns for the style you
  4853.  want.  (In this discussion, "column" will be used to refer both to a column in
  4854.  the data file and an entry in the `using` list.)
  4855.  
  4856.  For three columns, only `xerrorbars` (*note xerrorbars:: ),  `yerrorbars`
  4857.  (*note yerrorbars:: ) (or errorbars), boxes, and `boxerrorbars`
  4858.  (*note boxerrorbars:: ) are allowed.  If another plot style is used, the
  4859.  style will be changed to `yerrorbars`.  The `boxerrorbars` style will
  4860.  calculate the boxwidth automatically.
  4861.  
  4862.  For four columns, only `xerrorbars`, `yerrorbars` (or `errorbars`),
  4863.  `xyerrorbars` (*note xyerrorbars:: ),  `boxxyerrorbars`
  4864.  (*note boxxyerrorbars:: ), and boxerrorbars are allowed.  An illegal style
  4865.  will be changed to `yerrorbars`.
  4866.  
  4867.  Five-column data allow only the `boxerrorbars`, `financebars`
  4868.  (*note financebars:: ), and `candlesticks` (*note candlesticks:: )
  4869.  styles.  (The last two of these are primarily used for plots of financial
  4870.  prices.)  An illegal style will be changed to `boxerrorbars` before plotting.
  4871.  
  4872.  Six- and seven-column data only allow the `xyerrorbars` and `boxxyerrorbars`
  4873.  styles.  Illegal styles will be changed to `xyerrorbars` before plotting.
  4874.  
  4875.  For more information about error bars, please see `plot errorbars`.
  4876.  
  4877. * Menu:
  4878.  
  4879. * boxerrorbars::
  4880. * boxes::
  4881. * boxxyerrorbars::
  4882. * candlesticks::
  4883. * dots::
  4884. * financebars::
  4885. * fsteps::
  4886. * histeps::
  4887. * impulses::
  4888. * lines::
  4889. * linespoints::
  4890. * points::
  4891. * steps::
  4892. * vector::
  4893. * xerrorbars::
  4894. * xyerrorbars::
  4895. * yerrorbars::
  4896.  
  4897. 
  4898. File: gnuplot.info, Node: boxerrorbars, Prev: style, Up: style, Next: boxes
  4899.  
  4900.  The `boxerrorbars` style is only relevant to 2-d data plotting.  It is a
  4901.  combination of the `boxes` (*note boxes:: ) and  `yerrorbars`
  4902.  (*note yerrorbars:: ) styles.  The boxwidth will come from the fourth column
  4903.  if the y errors are in the form of "ydelta" and the boxwidth was not
  4904.  previously set equal to -2.0 (`set boxwidth -2.0`) or from the fifth column if
  4905.  the y errors are in the form of "ylow yhigh".  The special case  `boxwidth =
  4906.  -2.0` is for four-column data with y errors in the form "ylow yhigh".  In this
  4907.  case the boxwidth will be calculated so that each box touches the adjacent
  4908.  boxes.  The width will also be calculated in cases where three-column data are
  4909.  used.
  4910.  
  4911.  The box height is determined from the y error in the same way as it is for
  4912.  the `yerrorbars` style---either from y-ydelta to y+ydelta or from ylow to
  4913.  yhigh, depending on how many data columns are provided.
  4914.  
  4915. 
  4916. File: gnuplot.info, Node: boxes, Prev: boxerrorbars, Up: style, Next: boxxyerrorbars
  4917.  
  4918.  The `boxes` style is only relevant to 2-d plotting.  It draws a box centered
  4919.  about the given x coordinate from the x axis (not the graph border) to the
  4920.  given y coordinate.  The width of the box is obtained in one of three ways.
  4921.  If it is a data plot and the data file has a third column, this will be used
  4922.  to set the width of the box.  If not, if a width has been set using the `set
  4923.  boxwidth` command, this will be used.  If neither of these is available, the
  4924.  width of each box will be calculated automatically so that it touches the
  4925.  adjacent boxes.
  4926.  
  4927. 
  4928. File: gnuplot.info, Node: boxxyerrorbars, Prev: boxes, Up: style, Next: candlesticks
  4929.  
  4930.  The `boxxyerrorbars` style is only relevant to 2-d data plotting.  It is a
  4931.  combination of the `boxes` (*note boxes:: ) and  `xyerrorbars`
  4932.  (*note xyerrorbars:: ) styles.
  4933.  
  4934.  The box width and height are determined from the x and y errors in the same
  4935.  way as they are for the `xyerrorbars` style---either from xlow to xhigh and
  4936.  from ylow to yhigh, or from x-xdelta to x+xdelta and from y-ydelta to
  4937.  y+ydelta , depending on how many data columns are provided.
  4938.  
  4939. 
  4940. File: gnuplot.info, Node: candlesticks, Prev: boxxyerrorbars, Up: style, Next: dots
  4941.  
  4942.  The `candlesticks` style is only relevant for 2-d data plotting of financial
  4943.  data.  Five columns of data are required; in order, these should be the x
  4944.  coordinate (most likely a date) and the opening, low, high, and closing
  4945.  prices.  The symbol is an open rectangle, centered horizontally at the x
  4946.  coordinate and limited vertically by the opening and closing prices.  A
  4947.  vertical line segment at the x coordinate extends up from the top of the
  4948.  rectangle to the high price and another down to the low.  The width of the
  4949.  rectangle may be changed by `set bar` (*note bar:: ).  The symbol will be
  4950.  unchanged if the low and high prices are interchanged or if the opening and
  4951.  closing prices are interchanged.  See `set bar` and `financebars`
  4952.  (*note financebars:: ).
  4953.  
  4954.  
  4955. 
  4956. File: gnuplot.info, Node: dots, Prev: candlesticks, Up: style, Next: financebars
  4957.  
  4958.  The `dots` style plots a tiny dot at each point; this is useful for scatter
  4959.  plots with many points.
  4960.  
  4961. 
  4962. File: gnuplot.info, Node: financebars, Prev: dots, Up: style, Next: fsteps
  4963.  
  4964.  The `financebars` style is only relevant for 2-d data plotting of financial
  4965.  data.  Five columns of data are required; in order, these should be the x
  4966.  coordinate (most likely a date) and the opening, low, high, and closing
  4967.  prices.  The symbol is a vertical line segment, located horizontally at the x
  4968.  coordinate and limited vertically by the high and low prices.  A horizontal
  4969.  tic on the left marks the opening price and one on the right marks the
  4970.  closing price.  The length of these tics may be changed by `set bar`
  4971.  (*note bar:: ).  The symbol will be unchanged if the high and low prices are
  4972.  interchanged.  See `set bar` and `candlesticks` (*note candlesticks:: ).
  4973.  
  4974.  
  4975. 
  4976. File: gnuplot.info, Node: fsteps, Prev: financebars, Up: style, Next: histeps
  4977.  
  4978.  The `fsteps` style is only relevant to 2-d plotting.  It connects consecutive
  4979.  points with two line segments: the first from (x1,y1) to (x1,y2) and the
  4980.  second from (x1,y2) to (x2,y2).
  4981.  
  4982. 
  4983. File: gnuplot.info, Node: histeps, Prev: fsteps, Up: style, Next: impulses
  4984.  
  4985.  The `histeps` style is only relevant to 2-d plotting.  It is intended for
  4986.  plotting histograms.  Y-values are assumed to be centered at the x-values;
  4987.  the point at x1 is represented as a horizontal line from ((x0+x1)/2,y1) to
  4988.  ((x1+x2)/2,y1).  The lines representing the end points are extended so that
  4989.  the step is centered on at x.  Adjacent points are connected by a vertical
  4990.  line at their average x, that is, from ((x1+x2)/2,y1) to ((x1+x2)/2,y2).
  4991.  
  4992.  If `autoscale` (*note autoscale:: ) is in effect, it selects the xrange from
  4993.  the data rather than the steps, so the end points will appear only half as
  4994.  wide as the others.
  4995.  
  4996.  `histeps` is only a plotting style; `gnuplot` (*note gnuplot:: ) does not have
  4997.  the ability to create bins and determine their population from some data set.
  4998.  
  4999.  
  5000. 
  5001. File: gnuplot.info, Node: impulses, Prev: histeps, Up: style, Next: lines
  5002.  
  5003.  The `impulses` style displays a vertical line from the x axis (not the graph
  5004.  border), or from the grid base for `splot` (*note splot:: ), to each point.
  5005.  
  5006.  
  5007. 
  5008. File: gnuplot.info, Node: lines, Prev: impulses, Up: style, Next: linespoints
  5009.  
  5010.  The `lines` style connects adjacent points with straight line segments.
  5011.  
  5012. 
  5013. File: gnuplot.info, Node: linespoints, Prev: lines, Up: style, Next: points
  5014.  
  5015.  The `linespoints` style does both `lines` (*note lines:: ) and  `points`
  5016.  (*note points:: ), that is, it draws a small symbol at each point and then
  5017.  connects adjacent points with straight line segments.  The command `set
  5018.  pointsize` (*note pointsize:: ) may be used to change the size of the
  5019.  points.  See `set pointsize` for its usage.
  5020.  
  5021.  `linespoints` may be abbreviated `lp`.
  5022.  
  5023. 
  5024. File: gnuplot.info, Node: points, Prev: linespoints, Up: style, Next: steps
  5025.  
  5026.  The `points` style displays a small symbol at each point.  The command `set
  5027.  pointsize` may be used to change the size of the points.  See `set pointsize`
  5028.  (*note pointsize:: ) for its usage.
  5029.  
  5030.  
  5031. 
  5032. File: gnuplot.info, Node: steps, Prev: points, Up: style, Next: vector
  5033.  
  5034.  The `steps` style is only relevant to 2-d plotting.  It connects consecutive
  5035.  points with two line segments: the first from (x1,y1) to (x2,y1) and the
  5036.  second from (x2,y1) to (x2,y2).
  5037.  
  5038. 
  5039. File: gnuplot.info, Node: vector, Prev: steps, Up: style, Next: xerrorbars
  5040.  
  5041.  The `vector` style draws a vector from (x,y) to (x+xdelta,y+ydelta).  Thus
  5042.  it requires four columns of data.  It also draws a small arrowhead at the
  5043.  end of the vector.
  5044.  
  5045.  The `vector` style is still experimental: it doesn't get clipped properly
  5046.  and other things may also be wrong with it.  Use it at your own risk.
  5047.  
  5048. 
  5049. File: gnuplot.info, Node: xerrorbars, Prev: vector, Up: style, Next: xyerrorbars
  5050.  
  5051.  The `xerrorbars` style is only relevant to 2-d data plots.  `xerrorbars` is
  5052.  like `dots` (*note dots:: ), except that a horizontal error bar is also
  5053.  drawn.  At each point (x,y), a line is drawn from (xlow,y) to (xhigh,y) or
  5054.  from (x-xdelta,y) to (x+xdelta,y), depending on how many data columns are
  5055.  provided.  A tic mark is placed at the ends of the error bar (unless `set bar`
  5056.  (*note bar:: ) is used---see set bar` for details).
  5057.  
  5058.  
  5059. 
  5060. File: gnuplot.info, Node: xyerrorbars, Prev: xerrorbars, Up: style, Next: yerrorbars
  5061.  
  5062.  The `xyerrorbars` style is only relevant to 2-d data plots.  `xyerrorbars` is
  5063.  like `dots` (*note dots:: ), except that horizontal and vertical error bars
  5064.  are also drawn. At each point (x,y), lines are drawn from (x,y-ydelta) to
  5065.  (x,y+ydelta) and from (x-xdelta,y) to (x+xdelta,y) or from (x,ylow) to
  5066.  (x,yhigh) and from (xlow,y) to (xhigh,y), depending upon the number of data
  5067.  columns provided.  A tic mark is placed at the ends of the error bar (unless
  5068.  `set bar` (*note bar:: ) is used---see `set bar` for details).
  5069.  
  5070.  If data are provided in an unsupported mixed form, the `using`
  5071.  (*note using:: ) filter on the `plot` (*note plot:: ) command should be used
  5072.  to set up the appropriate form.  For example, if the data are of the form
  5073.  (x,y,xdelta,ylow,yhigh), then you can use
  5074.  
  5075.        plot 'data' using 1:2:($1-$3),($1+$3),4,5 with xyerrorbars
  5076.  
  5077. 
  5078. File: gnuplot.info, Node: yerrorbars, Prev: xyerrorbars, Up: style
  5079.  
  5080.  The `yerrorbars` (or `errorbars` (*note errorbars:: )) style is only relevant
  5081.  to 2-d data plots. `yerrorbars` is like `dots` (*note dots:: ), except that a
  5082.  vertical error bar is also drawn. At each point (x,y), a line is drawn from
  5083.  (x,y-ydelta) to (x,y+ydelta) or from (x,ylow) to (x,yhigh), depending on how
  5084.  many data columns are provided. A tic mark is placed at the ends of the error
  5085.  bar (unless `set bar` (*note bar:: ) is used---see `set bar` for details).
  5086.  
  5087.  
  5088. 
  5089. File: gnuplot.info, Node: surface, Prev: style, Up: set-show, Next: terminal
  5090.  
  5091.  The command `set surface` controls the display of surfaces by `splot`
  5092.  (*note splot:: ).
  5093.  
  5094.  Syntax:
  5095.        set surface
  5096.        set nosurface
  5097.        show surface
  5098.  
  5099.  The surface is drawn with the style specifed by `with` (*note with:: ), or
  5100.  else the appropriate style, data or function.
  5101.  
  5102.  Whenever `set nosurface` is issued, `splot` will not draw points or lines
  5103.  corresponding to the function or data file points.  Contours may be still be
  5104.  drawn on the surface, depending on the `set contour` (*note contour:: )
  5105.  option. set nosurface; set contour base` is useful for displaying contours on
  5106.  the grid base.  See also `set contour`.
  5107.  
  5108.  
  5109. 
  5110. File: gnuplot.info, Node: terminal, Prev: surface, Up: set-show, Next: aed767
  5111.  
  5112.  `gnuplot` (*note gnuplot:: ) supports many different graphics devices.  Use
  5113.  set terminal to tell `gnuplot` what kind of output to generate. Use `set
  5114.  output` (*note output:: ) to redirect that output to a file or device.
  5115.  
  5116.  Syntax:
  5117.        set terminal {<terminal-type>}
  5118.        show terminal
  5119.  
  5120.  If <terminal-type> is omitted, `gnuplot` will list the available terminal
  5121.  types.  <terminal-type> may be abbreviated.
  5122.  
  5123.  If both `set terminal` and `set output` are used together, it is safest to
  5124.  give `set terminal` first, because some terminals set a flag which is needed
  5125.  in some operating systems.
  5126.  
  5127.  Several terminals have additional options.  For example, see `dumb`
  5128.  (*note dumb:: ), `iris4d`, `hpljii` (*note hpljii:: ) or  `postscript`
  5129.  (*note postscript:: ).
  5130.  
  5131.  This document may describe drivers that are not available to you because they
  5132.  were not installed, or it may not describe all the drivers that are available
  5133.  to you, depending on its output format.
  5134.  
  5135. * Menu:
  5136.  
  5137. * aed767::
  5138. * unixplot::
  5139. * gpic::
  5140. * regis::
  5141. * tek410x::
  5142. * tek40::
  5143. * xlib::
  5144. * x11::
  5145. * aifm::
  5146. * cgm::
  5147. * corel::
  5148. * dumb::
  5149. * dxf::
  5150. * fig::
  5151. * hp2623a::
  5152. * hp2648::
  5153. * hp500c::
  5154. * hpgl::
  5155. * hpljii::
  5156. * hppj::
  5157. * imagen::
  5158. * mif::
  5159. * pbm::
  5160. * png::
  5161. * postscript::
  5162. * qms::
  5163. * table::
  5164. * tgif::
  5165. * tkcanvas::
  5166. * epson-180dpi::
  5167. * latex::
  5168. * pslatex and pstex::
  5169. * eepic::
  5170. * tpic::
  5171. * pstricks::
  5172. * texdraw::
  5173. * mf::
  5174. * mp::
  5175.  
  5176. 
  5177. File: gnuplot.info, Node: aed767, Prev: terminal, Up: terminal, Next: unixplot
  5178.  
  5179.  The `aed512` and `aed767` terminal drivers support AED graphics terminals.
  5180.  The two drivers differ only in their horizontal ranges, which are 512 and
  5181.  768 pixels, respectively.  Their vertical range is 575 pixels.  There are
  5182.  no options for these drivers.
  5183.  
  5184. 
  5185. File: gnuplot.info, Node: unixplot, Prev: aed767, Up: terminal, Next: gpic
  5186.  
  5187.  The `unixplot` driver produces device-independent output in the GNU plot
  5188.  graphics language.  The default size of the PostScript results generated by
  5189.  "plot2ps" is 5 x 3 inches; this can be increased up to about 8.25 x 8.25 by
  5190.  `set size` (*note size:: ).
  5191.  
  5192.  Syntax:
  5193.        set terminal unixplot {"<fontname>"} {<fontsize>}
  5194.  
  5195.  which defaults to 10-point "Courier".
  5196.  
  5197.  There is a non-GNU version of the `unixplot` driver which cannot be compiled
  5198.  unless this version is left out.
  5199.  
  5200. 
  5201. File: gnuplot.info, Node: gpic, Prev: unixplot, Up: terminal, Next: regis
  5202.  
  5203.  The `gpic` terminal driver generates GPIC graphs in the Free Software
  5204.  Foundations's "groff" package.  The default size is 5 x 3 inches.  The only
  5205.  option is the origin, which defaults to (0,0).
  5206.  
  5207.  Syntax:
  5208.        set terminal gpic {<x> <y>}
  5209.  
  5210.  where `x` and `y` are in inches.
  5211.  
  5212.  A simple graph can be formatted using
  5213.  
  5214.        groff -p -mpic -Tps file.pic > file.ps.
  5215.  
  5216.  The output from pic can be pipe-lined into eqn, so it is possible to put
  5217.  complex functions in a graph with the `set label` (*note label:: ) and set
  5218.  {x/y}label commands.  For instance,
  5219.  
  5220.        set ylab '@space 0 int from 0 to x alpha ( t ) roman d t@'
  5221.  
  5222.  will label the y axis with a nice integral if formatted with the command:
  5223.  
  5224.        gpic filename.pic | geqn -d@@ -Tps | groff -m[macro-package] -Tps
  5225.            > filename.ps
  5226.  
  5227.  Figures made this way can be scaled to fit into a document.  The pic language
  5228.  is easy to understand, so the graphs can be edited by hand if need be.  All
  5229.  co-ordinates in the pic-file produced by `gnuplot` (*note gnuplot:: ) are
  5230.  given as x+gnuplotx and y+gnuploty.  By default x and y are given the value
  5231.  0.  If this line is removed with an editor in a number of files, one can put
  5232.  several graphs in one figure like this (default size is 5.0x3.0 inches):
  5233.  
  5234.        .PS 8.0
  5235.        x=0;y=3
  5236.        copy "figa.pic"
  5237.        x=5;y=3
  5238.        copy "figb.pic"
  5239.        x=0;y=0
  5240.        copy "figc.pic"
  5241.        x=5;y=0
  5242.        copy "figd.pic"
  5243.        .PE
  5244.  
  5245.  This will produce an 8-inch-wide figure with four graphs in two rows on top
  5246.  of each other.
  5247.  
  5248.  One can also achieve the same thing by the command
  5249.  
  5250.        set terminal gpic x y
  5251.  
  5252.  for example, using
  5253.  
  5254.        .PS 6.0
  5255.        copy "trig.pic"
  5256.        .PE
  5257.  
  5258. 
  5259. File: gnuplot.info, Node: regis, Prev: gpic, Up: terminal, Next: tek410x
  5260.  
  5261.  The `regis` terminal device generates output in the REGIS graphics language.
  5262.  It has the option of using 4 (the default) or 16 colors.
  5263.  
  5264.  Syntax:
  5265.        set terminal regis {4 | 16}
  5266.  
  5267. 
  5268. File: gnuplot.info, Node: tek410x, Prev: regis, Up: terminal, Next: tek40
  5269.  
  5270.  The `tek410x` terminal driver supports the 410x and 420x family of Tektronix
  5271.  terminals.  It has no options.
  5272.  
  5273. 
  5274. File: gnuplot.info, Node: tek40, Prev: tek410x, Up: terminal, Next: xlib
  5275.  
  5276.  This family of terminal drivers supports a variety of VT-like terminals.
  5277.  `tek40xx` supports Tektronix 4010 and others as well as most TEK emulators;
  5278.  `vttek` supports VT-like tek40xx terminal emulators; `kc-tek40xx` supports
  5279.  MS-DOS Kermit Tek4010 terminal emulators in color: `km-tek40xx` supports them
  5280.  in monochrome; `selanar` supports Selanar graphics; and `bitgraph` supports
  5281.  BBN Bitgraph terminals.  None have any options.
  5282.  
  5283. 
  5284. File: gnuplot.info, Node: xlib, Prev: tek40, Up: terminal, Next: x11
  5285.  
  5286.  The `xlib` terminal driver supports the X11 Windows System.  It generates
  5287.  gnulib_x11 commands.  `set term x11` (*note x11:: ) behaves similarly to set
  5288.  terminal xlib; set output "|gnuplot_x11"`.  `xlib` has no options, but see
  5289.  `x11`.
  5290.  
  5291.  
  5292. 
  5293. File: gnuplot.info, Node: x11, Prev: xlib, Up: terminal, Next: command-line_options
  5294.  
  5295.  `gnuplot` (*note gnuplot:: ) provides the x11 terminal type for use with X
  5296.  servers.  This terminal type is set automatically at startup if the `DISPLAY`
  5297.  environment variable is set, if the `TERM` environment variable is set to
  5298.  `xterm`, or if the `-display` command line option is used.
  5299.  
  5300.  Syntax:
  5301.        set terminal x11 {reset} {<n>}
  5302.  
  5303.  Multiple plot windows are supported: `set terminal x11 <n>` directs the
  5304.  output to plot window number n.  If n>0, the terminal number will be
  5305.  appended to the window title and the icon will be labeled `gplt <n>`.
  5306.  The active window may distinguished by a change in cursor (from default
  5307.  to crosshair.)
  5308.  
  5309.  Plot windows remain open even when the `gnuplot` driver is changed to a
  5310.  different device.  A plot window can be closed by pressing the letter q
  5311.  while that window has input focus, or by choosing `close` from a window
  5312.  manager menu.  All plot windows can be closed by specifying `reset`
  5313.  (*note reset:: ), which actually terminates the subprocess which maintains the
  5314.  windows (unless `-persist` was specified).
  5315.  
  5316.  Plot windows will automatically be closed at the end of the session
  5317.  unless the `-persist` option was given.
  5318.  
  5319.  The size or aspect ratio of a plot may be changed by resizing the `gnuplot`
  5320.  window.
  5321.  
  5322.  Linewidths and pointsizes may be changed from within `gnuplot` with
  5323.  `set linestyle` (*note linestyle:: ).
  5324.  
  5325.  For terminal type `x11`, `gnuplot` accepts (when initialized) the standard
  5326.  X Toolkit options and resources such as geometry, font, and name from the
  5327.  command line arguments or a configuration file.  See the X(1) man page
  5328.  (or its equivalent) for a description of such options.
  5329.  
  5330.  A number of other `gnuplot` options are available for the `x11` terminal.
  5331.  These may be specified either as command-line options when `gnuplot` is
  5332.  invoked or as resources in the configuration file "/.Xdefaults".  They are
  5333.  set upon initialization and cannot be altered during a `gnuplot` session.
  5334.  
  5335. * Menu:
  5336.  
  5337. * command-line_options::
  5338. * monochome_options::
  5339. * color_resources::
  5340. * grayscale_resources::
  5341. * line_resources::
  5342.  
  5343. 
  5344. File: gnuplot.info, Node: command-line_options, Prev: x11, Up: x11, Next: monochome_options
  5345.  
  5346.  In addition to the X Toolkit options, the following options may be specified
  5347.  on the command line when starting `gnuplot` (*note gnuplot:: ) or as resources
  5348.  in your ".Xdefaults" file:  `-clear`   requests that the window be cleared
  5349.  momentarily before a             new plot is displayed.  `-gray`    requests
  5350.  grayscale rendering on grayscale or color displays.             (Grayscale
  5351.  displays receive monochrome rendering by default.)  `-mono`    forces
  5352.  monochrome rendering on color displays.  `-persist` plot windows survive after
  5353.  main gnuplot program exits  `-raise`   raise plot window after each plot
  5354.   `-noraise` do not raise plot window after each plot  `-tvtwm`   requests that
  5355.  geometry specifications for position of the             window be made
  5356.  relative to the currently displayed portion             of the virtual root.
  5357.  The options are shown above in their command-line syntax.  When entered as
  5358.  resources in ".Xdefaults", they require a different syntax.
  5359.  
  5360.  Example:
  5361.        gnuplot*gray: on
  5362.  
  5363.  `gnuplot` also provides a command line option (`-pointsize <v>`) and a
  5364.  resource, `gnuplot*pointsize: <v>`, to control the size of points plotted
  5365.  with the `points` (*note points:: ) plotting style.  The value v is a real
  5366.  number (greater than 0 and less than or equal to ten) used as a scaling factor
  5367.  for point sizes.  For example, `-pointsize 2` uses points twice the default
  5368.  size, and `-pointsize 0.5` uses points half the normal size.
  5369.  
  5370.  
  5371. 
  5372. File: gnuplot.info, Node: monochome_options, Prev: command-line_options, Up: x11, Next: color_resources
  5373.  
  5374.  For monochrome displays, `gnuplot` (*note gnuplot:: ) does not honor
  5375.  foreground or background colors.  The default is black-on-white.  `-rv` or
  5376.  `gnuplot*reverseVideo: on` requests white-on-black.
  5377.  
  5378.  
  5379. 
  5380. File: gnuplot.info, Node: color_resources, Prev: monochome_options, Up: x11, Next: grayscale_resources
  5381.  
  5382.  For color displays, `gnuplot` (*note gnuplot:: ) honors the following
  5383.  resources (shown here with their default values) or the greyscale
  5384.  resources.  The values may be color names as listed in the X11 rgb.txt file on
  5385.  your system, hexadecimal RGB color specifications (see X11 documentation), or
  5386.  a color name followed by a comma and an `intensity` value from 0 to 1.  For
  5387.  example, `blue, 0.5` means a half intensity blue.  gnuplot*background:  white
  5388.   gnuplot*textColor:   black  gnuplot*borderColor: black  gnuplot*axisColor:
  5389.    black  gnuplot*line1Color:  red  gnuplot*line2Color:  green
  5390.   gnuplot*line3Color:  blue  gnuplot*line4Color:  magenta  gnuplot*line5Color:
  5391.   cyan  gnuplot*line6Color:  sienna  gnuplot*line7Color:  orange
  5392.   gnuplot*line8Color:  coral
  5393.  
  5394.  The command-line syntax for these is, for example,
  5395.  
  5396.  Example:
  5397.        gnuplot -background coral
  5398.  
  5399.  
  5400. 
  5401. File: gnuplot.info, Node: grayscale_resources, Prev: color_resources, Up: x11, Next: line_resources
  5402.  
  5403.  When `-gray` is selected, `gnuplot` (*note gnuplot:: ) honors the following
  5404.  resources for grayscale or color displays (shown here with their default
  5405.  values).  Note that the default background is black.  gnuplot*background:
  5406.  black  gnuplot*textGray:   white  gnuplot*borderGray: gray50
  5407.   gnuplot*axisGray:   gray50  gnuplot*line1Gray:  gray100  gnuplot*line2Gray:
  5408.   gray60  gnuplot*line3Gray:  gray80  gnuplot*line4Gray:  gray40
  5409.   gnuplot*line5Gray:  gray90  gnuplot*line6Gray:  gray50  gnuplot*line7Gray:
  5410.   gray70  gnuplot*line8Gray:  gray30
  5411.  
  5412.  
  5413. 
  5414. File: gnuplot.info, Node: line_resources, Prev: grayscale_resources, Up: x11
  5415.  
  5416.  `gnuplot` (*note gnuplot:: ) honors the following resources for setting the
  5417.  width (in pixels) of plot lines (shown here with their default values.)  0 or
  5418.  1 means a minimal width line of 1 pixel width.  A value of 2 or 3 may improve
  5419.  the appearance of some plots.  gnuplot*borderWidth: 2  gnuplot*axisWidth:   0
  5420.   gnuplot*line1Width:  0  gnuplot*line2Width:  0  gnuplot*line3Width:  0
  5421.   gnuplot*line4Width:  0  gnuplot*line5Width:  0  gnuplot*line6Width:  0
  5422.   gnuplot*line7Width:  0  gnuplot*line8Width:  0
  5423.  
  5424.  `gnuplot` honors the following resources for setting the dash style used for
  5425.  plotting lines.  0 means a solid line.  A two-digit number `jk` (`j` and `k`
  5426.  are >= 1  and <= 9) means a dashed line with a repeated pattern of `j` pixels
  5427.  on followed by `k` pixels off.  For example, '16' is a "dotted" line with one
  5428.  pixel on followed by six pixels off.  More elaborate on/off patterns can be
  5429.  specified with a four-digit value.  For example, '4441' is four on, four off,
  5430.  four on, one off.  The default values shown below are for monochrome displays
  5431.  or monochrome rendering on color or grayscale displays.  For color displays,
  5432.  the default for each is 0 (solid line) except for `axisDashes` which defaults
  5433.  to a '16' dotted line.
  5434.   gnuplot*borderDashes:   0
  5435.   gnuplot*axisDashes:    16
  5436.   gnuplot*line1Dashes:    0
  5437.   gnuplot*line2Dashes:   42
  5438.   gnuplot*line3Dashes:   13
  5439.   gnuplot*line4Dashes:   44
  5440.   gnuplot*line5Dashes:   15
  5441.   gnuplot*line6Dashes: 4441
  5442.   gnuplot*line7Dashes:   42
  5443.   gnuplot*line8Dashes:   13
  5444.  
  5445. 
  5446. File: gnuplot.info, Node: aifm, Prev: x11, Up: terminal, Next: cgm
  5447.  
  5448.  Several options may be set in `aifm`---the Adobe Illustrator 3.0+ driver.
  5449.  
  5450.  Syntax:
  5451.        set terminal aifm {<color>} {"<fontname>"} {<fontsize>}
  5452.  
  5453.  <color> is either `color` or `monochrome`; "<fontname>" is the name of a
  5454.  valid PostScript font; <fontsize> is the size of the font in PostScript
  5455.  points, before scaling by the `set size` (*note size:: ) command.  Selecting
  5456.  default sets all options to their default values: `monochrome`, "Helvetica",
  5457.  and 14pt.
  5458.  
  5459.  Since AI does not really support multiple pages, multiple graphs will be
  5460.  drawn directly on top of one another.  However, each graph will be grouped
  5461.  individually, making it easy to separate them inside AI (just pick them up
  5462.  and move them).
  5463.  
  5464.  Examples:
  5465.        set term aifm
  5466.        set term aifm 22
  5467.        set size 0.7,1.4; set term aifm color "Times-Roman" 14
  5468.  
  5469. 
  5470. File: gnuplot.info, Node: cgm, Prev: aifm, Up: terminal, Next: font
  5471.  
  5472.  The `cgm` terminal generates a Computer Graphics Metafile.  This file format
  5473.  is a subset of the ANSI X3.122-1986 standard entitled "Computer Graphics -
  5474.  Metafile for the Storage and Transfer of Picture Description Information".
  5475.  Several options may be set in `cgm`.
  5476.  
  5477.  Syntax:
  5478.        set terminal cgm {<mode>} {<color>} {<rotation>} {solid | dashed}
  5479.                         {width <plot_width>} {linewidth <line_width>}
  5480.                         {"<font>"} {<fontsize>}
  5481.  
  5482.  where <mode> is `landscape`, `portrait`, or `default`;
  5483.  <color> is either `color` or `monochrome`; 
  5484.  <rotation> is either `rotate` (*note rotate:: ) or norotate; `solid`
  5485.  (*note solid:: ) draws all curves with solid lines, overriding any dashed
  5486.  patterns; <plot_width> is the width of the page in points;  <line_width> is
  5487.  the line width in points;  <font> is the name of a font; and  `<fontsize>` is
  5488.  the size of the font in points.
  5489.  
  5490.  By default, `cgm` uses rotated text for the Y axis label.
  5491.  
  5492.  The first six options can be in any order.  Selecting `default` sets all
  5493.  options to their default values.
  5494.  
  5495.  Examples:
  5496.        set terminal cgm landscape color rotate dashed width 432 \
  5497.                       linewidth 1  'Arial Bold' 12       # defaults
  5498.        set terminal cgm 14 linewidth 2  14  # wider lines & larger font
  5499.        set terminal cgm portrait 'Times Roman Italic' 12
  5500.        set terminal cgm color solid    # no pesky dashes!
  5501.  
  5502. * Menu:
  5503.  
  5504. * font::
  5505. * fontsize::
  5506. * linewidth::
  5507. * rotate::
  5508. * solid::
  5509. * size::
  5510. * width::
  5511. * winword6::
  5512.  
  5513. 
  5514. File: gnuplot.info, Node: font, Prev: cgm, Up: cgm, Next: fontsize
  5515.  
  5516.  The first part of a Computer Graphics Metafile, the metafile description,
  5517.  includes a font table.  In the picture body, a font is designated by an
  5518.  index into this table.  By default, this terminal generates a table with
  5519.  the following fonts:
  5520.        Arial
  5521.        Arial Italic
  5522.        Arial Bold
  5523.        Arial Bold Italic
  5524.        Times Roman
  5525.        Times Roman Italic
  5526.        Times Roman Bold
  5527.        Times Roman Bold Italic
  5528.        Helvetica
  5529.        Roman
  5530.  Case is not distinct, but the modifiers must appear in the above order (that
  5531.  is, not 'Arial Italic Bold').  'Arial Bold' is the default font.
  5532.  
  5533.  You may also specify a font name which does not appear in the default font
  5534.  table.  In that case, a new font table is constructed with the specified
  5535.  font as its only entry.  You must ensure that the spelling, capitalization,
  5536.  and spacing of the name are appropriate for the application that will read
  5537.  the CGM file.
  5538.  
  5539. 
  5540. File: gnuplot.info, Node: fontsize, Prev: font, Up: cgm, Next: linewidth
  5541.  
  5542.  Fonts are scaled assuming the page is 6 inches wide.  If the `size`
  5543.  (*note size:: ) command is used to change the aspect ratio of the page or the
  5544.  CGM file is converted to a different width (e.g. it is imported into a
  5545.  document in which the margins are not 6 inches apart), the resulting font
  5546.  sizes will be different. To change the assumed width, use the `width`
  5547.  (*note width:: ) option.
  5548.  
  5549.  
  5550. 
  5551. File: gnuplot.info, Node: linewidth, Prev: fontsize, Up: cgm, Next: rotate
  5552.  
  5553.  The `linewidth` option sets the width of lines in pt.  The default width is
  5554.  1 pt.  Scaling is affected by the actual width of the page, as discussed
  5555.  under the `fontsize` (*note fontsize:: ) and  `width` (*note width:: )
  5556.  options
  5557.  
  5558.  
  5559. 
  5560. File: gnuplot.info, Node: rotate, Prev: linewidth, Up: cgm, Next: solid
  5561.  
  5562.  The `norotate` option may be used to disable text rotation.  For example,
  5563.  the CGM input filter for Word for Windows 6.0c can accept rotated text, but
  5564.  the DRAW editor within Word cannot.  If you edit a graph (for example, to
  5565.  label a curve), all rotated text is restored to horizontal.  The Y axis
  5566.  label will then extend beyond the clip boundary.  With `norotate`, the Y
  5567.  axis label starts in a less attractive location, but the page can be edited
  5568.  without damage.  The `rotate` option confirms the default behavior.
  5569.  
  5570. 
  5571. File: gnuplot.info, Node: solid, Prev: rotate, Up: cgm, Next: size
  5572.  
  5573.  The `solid` option may be used to disable dashed line styles in the
  5574.  plots.  This is useful when color is enabled and the dashing of the lines
  5575.  detracts from the appearance of the plot. The `dashed` option confirms the
  5576.  default behavior, which gives a different dash pattern to each curve.
  5577.  
  5578. 
  5579. File: gnuplot.info, Node: size, Prev: solid, Up: cgm, Next: width
  5580.  
  5581.  Default size of a CGM page is 32599 units wide and 23457 units high for
  5582.  landscape, or 23457 units wide by 32599 units high for portrait.
  5583.  
  5584. 
  5585. File: gnuplot.info, Node: width, Prev: size, Up: cgm, Next: winword6
  5586.  
  5587.  All distances in the CGM file are in abstract units.  The application that
  5588.  reads the file determines the size of the final page.  By default, the width
  5589.  of the final page is assumed to be 6 inches (15.24 cm).  This distance is
  5590.  used to calculate the correct font size, and may be changed with the `width`
  5591.  option.  The keyword should be followed by the width in points.  (Here, a
  5592.  point is 1/72 inch, as in PostScript.  This unit is known as a "big point"
  5593.  in TeX.)  `gnuplot` (*note gnuplot:: ) arithmetic can be used to convert from
  5594.  other units, as follows:       set terminal cgm width 432            #
  5595.  default       set terminal cgm width 6*72           # same as above       set
  5596.  terminal cgm width 10/2.54*72     # 10 cm wide
  5597.  
  5598.  
  5599. 
  5600. File: gnuplot.info, Node: winword6, Prev: width, Up: cgm
  5601.  
  5602.  The default font table was chosen to match, where possible, the default font
  5603.  assignments made by the Computer Graphics Metafile input filter for
  5604.  Microsoft Word 6.0c, although the filter makes available only 'Arial' and
  5605.  'Times Roman' fonts and their bold and/or italic variants.  Other fonts such
  5606.  as 'Helvetica' and 'Roman' are not available.  If the CGM file includes a
  5607.  font table, the filter mostly ignores it.  However, it changes certain font
  5608.  assignments so that they disagree with the table.  As a workaround, the
  5609.  `winword6` option deletes the font table from the CGM file.  In this case,
  5610.  the filter makes predictable font assignments.  'Arial Bold' is correctly
  5611.  assigned even with the font table present, which is one reason it was chosen
  5612.  as the default.
  5613.  
  5614.  `winword6` disables the color tables for a similar reason---with the color
  5615.  table included, Microsoft Word displays black for color 7.
  5616.  
  5617.  Linewidths and pointsizes may be changed with `set linestyle`
  5618.  (*note linestyle:: ).
  5619.  
  5620.  
  5621. 
  5622. File: gnuplot.info, Node: corel, Prev: cgm, Up: terminal, Next: dumb
  5623.  
  5624.  The `corel` terminal driver supports CorelDraw.
  5625.  
  5626.  Syntax:
  5627.        set terminal corel {  default
  5628.                            | {monochrome | color
  5629.                                 {<fontname> {"<fontsize>" 
  5630.                                    {<xsize> <ysize> {<linewidth> }}}}}
  5631.  
  5632.  where the fontsize and linewidth are specified in points and the sizes in
  5633.  inches.  The defaults are monochrome, "SwitzerlandLight", 22, 8.2, 10 and 1.2.
  5634.  
  5635. 
  5636. File: gnuplot.info, Node: dumb, Prev: corel, Up: terminal, Next: dxf
  5637.  
  5638.  The `dumb` terminal driver has an optional size specification and trailing
  5639.  linefeed control.
  5640.  
  5641.  Syntax:
  5642.        set terminal dumb {[no]feed} {<xsize> <ysize>}
  5643.  
  5644.  where <xsize> and <ysize> set the size of the dumb terminals. Default is
  5645.  79 by 24. The last newline is printed only if `feed` is enabled.
  5646.  
  5647.  Examples:
  5648.        set term dumb nofeed
  5649.        set term dumb 79 49 # VGA screen---why would anyone do that?
  5650.  
  5651. 
  5652. File: gnuplot.info, Node: dxf, Prev: dumb, Up: terminal, Next: fig
  5653.  
  5654.  The `dxf` terminal driver creates pictures that can be imported into AutoCad
  5655.  (Release 10.x).  It has no options of its own, but some features of its plots
  5656.  may be modified by other means.  The default size is 120x80 AutoCad units,
  5657.  which can be changed by `set size` (*note size:: ).  dxf uses seven colors
  5658.  (white, red, yellow, green, cyan, blue and magenta), which can be changed only
  5659.  by modifying the source file.  If a black-and-white plotting device is used,
  5660.  the colors are mapped to differing line thicknesses.  See the description of
  5661.  the AutoCad print/plot command.
  5662.  
  5663.  
  5664. 
  5665. File: gnuplot.info, Node: fig, Prev: dxf, Up: terminal, Next: hp2623a
  5666.  
  5667.  The `fig` terminal device generates output in the Fig graphics language.
  5668.  
  5669.  Syntax:
  5670.        set terminal fig {monochrome | color} {small | big}
  5671.                         {pointsmax <max_points>}
  5672.                         {landscape | portrait}
  5673.                         {metric | inches}
  5674.                         {fontsize <fsize>}
  5675.                         {size <xsize> <ysize>}
  5676.                         {thickness <units>}
  5677.                         {depth <layer>}
  5678.  
  5679.  `monochrome` and `color` determine whether the picture is black-and-white or
  5680.  `color`.  `small` and `big` produce a 5x3 or 8x5 inch graph in the default
  5681.  `landscape` mode and 3x5 or 5x8 inches in `portrait` mode.  <max_points>
  5682.  sets the maximum number of points per polyline.  Default units for editing
  5683.  with "xfig" may be `metric` or `inches`.  `fontsize` (*note fontsize:: ) sets
  5684.  the size of the text font to <fsize> points.  `size` (*note size:: ) sets
  5685.  (overrides) the size of the drawing area to <xsize>*<ysize> in units of inches
  5686.  or centimeters depending on the `inches` or `metric` setting in
  5687.  effect.  `depth` sets the default depth layer for all lines and text.  The
  5688.  default depth is 10 to leave room for adding material with "xfig" on top of
  5689.  the plot.
  5690.  
  5691.  `thickness` sets the default line thickness, which is 1 if not specified.
  5692.  Overriding the thickness can be achieved by adding a multiple of 100 to the
  5693.  to the `linetype` value for a `plot` (*note plot:: ) command.  In a similar
  5694.  way the depth of plot elements (with respect to the default depth) can be
  5695.  controlled by adding a multiple of 1000 to <linetype>.  The depth is then
  5696.  <layer> + <linetype>/1000 and the thickness is (<linetype>%1000)/100 or, if
  5697.  that is zero, the default line thickness.
  5698.  
  5699.  Additional point-plot symbols are also available with the `fig` driver. The
  5700.  symbols can be used through `pointtype` values % 100 above 50, with different
  5701.  fill intensities controlled by <pointtype> % 5 and outlines in black (for
  5702.  <pointtype> % 10 < 5) or in the current color.  Available symbols are
  5703.          50 - 59:  circles
  5704.          60 - 69:  squares
  5705.          70 - 79:  diamonds
  5706.          80 - 89:  upwards triangles
  5707.          90 - 99:  downwards triangles
  5708.  The size of these symbols is linked to the font size.  The depth of symbols
  5709.  is by default one less than the depth for lines to achieve nice error bars.
  5710.  If <pointtype> is above 1000, the depth is <layer> + <pointtype>/1000-1.  If
  5711.  <pointtype>%1000 is above 100, the fill color is (<pointtype>%1000)/100-1.
  5712.  
  5713.  Available fill colors are (from 1 to 9): black, blue, green, cyan, red,
  5714.  magenta, yellow, white and dark blue (in monochrome mode: black for 1 to 6
  5715.  and white for 7 to 9).
  5716.  
  5717.  See `plot with` (*note with:: ) for details of <linetype> and <pointtype>.
  5718.  
  5719.  The `big` option is a substitute for the `bfig` terminal in earlier versions,
  5720.  which is no longer supported.
  5721.  
  5722.  Examples:
  5723.        set terminal fig monochrome small pointsmax 1000  # defaults
  5724.  
  5725.        plot 'file.dat' with points linetype 102 pointtype 759
  5726.  would produce circles with a blue outline of width 1 and yellow fill color.
  5727.  
  5728.        plot 'file.dat' using 1:2:3 with err linetype 1 pointtype 554
  5729.  would produce errorbars with black lines and circles filled red.  These
  5730.  circles are one layer above the lines (at depth 9 by default).
  5731.  
  5732.  To plot the error bars on top of the circles use
  5733.        plot 'file.dat' using 1:2:3 with err linetype 1 pointtype 2554
  5734.  
  5735. 
  5736. File: gnuplot.info, Node: hp2623a, Prev: fig, Up: terminal, Next: hp2648
  5737.  
  5738.  The `hp2623a` terminal driver supports the Hewlett Packard HP2623A.  It has
  5739.  no options.
  5740.  
  5741. 
  5742. File: gnuplot.info, Node: hp2648, Prev: hp2623a, Up: terminal, Next: hp500c
  5743.  
  5744.  The `hp2648` terminal driver supports the Hewlett Packard HP2647 and HP2648.
  5745.  It has no options.
  5746.  
  5747. 
  5748. File: gnuplot.info, Node: hp500c, Prev: hp2648, Up: terminal, Next: hpgl
  5749.  
  5750.  The `hp500c` terminal driver supports the Hewlett Packard HP DeskJet 500c.
  5751.  It has options for resolution and compression.
  5752.  
  5753.  Syntax:
  5754.        set terminal hp500c {<res>} {<comp>}
  5755.  
  5756.  where `res` can be 75, 100, 150 or 300 dots per inch and `comp` can be "rle",
  5757.  or "tiff".  Any other inputs are replaced by the defaults, which are 75 dpi
  5758.  and no compression.  Rasterization at the higher resolutions may require a
  5759.  large amount of memory.
  5760.  
  5761. 
  5762. File: gnuplot.info, Node: hpgl, Prev: hp500c, Up: terminal, Next: hpljii
  5763.  
  5764.  The `hpgl` driver produces HPGL output for devices like the HP7475A plotter.
  5765.  There are two options which can be set---the number of pens and "eject", which
  5766.  tells the plotter to eject a page when done.  The default is to use 6 pens
  5767.  and not to eject the page when done.
  5768.  
  5769.  The international character sets ISO-8859-1 and CP850 are recognized via
  5770.  `set encoding iso_8859_1` or `set encoding cp850` (see `set encoding`
  5771.  (*note encoding:: ) for details).
  5772.  
  5773.  Syntax:
  5774.        set terminal hpgl {<number_of_pens>} {eject}
  5775.  
  5776.  The selection
  5777.  
  5778.        set terminal hpgl 8 eject
  5779.  
  5780.  is equivalent to the previous `hp7550` terminal, and the selection
  5781.  
  5782.        set terminal hpgl 4
  5783.  
  5784.  is equivalent to the previous `hp7580b` terminal.
  5785.  
  5786.  The `pcl5` driver supports the Hewlett-Packard Laserjet III.  It actually uses
  5787.  HPGL-2, but there is a name conflict among the terminal devices.  It has
  5788.  several options
  5789.  
  5790.  Syntax:
  5791.        set terminal pcl5 {<mode>} {<font>} {<fontsize>}
  5792.  
  5793.  where <mode> is `landscape`, or `portrait`, <font> is `stick`, `univers`, or
  5794.  `cg_times`, and <fontsize> is the size in points.
  5795.  
  5796.  With `pcl5` international characters are handled by the printer; you just put
  5797.  the appropriate 8-bit character codes into the text strings.  You don't need
  5798.  to bother with `set encoding`.
  5799.  
  5800.  HPGL graphics can be imported by many software packages.
  5801.  
  5802. 
  5803. File: gnuplot.info, Node: hpljii, Prev: hpgl, Up: terminal, Next: hppj
  5804.  
  5805.  The `hpljii` terminal driver supports the HP Laserjet Series II printer.  The
  5806.  `hpdj` driver supports the HP DeskJet 500 printer.  These drivers allow a
  5807.  choice of resolutions.
  5808.  
  5809.  Syntax:
  5810.        set terminal hpljii | hpdj {<res>}
  5811.  
  5812.  where `res` may be 75, 100, 150 or 300 dots per inch; the default is 75.
  5813.  Rasterization at the higher resolutions may require a large amount of memory.
  5814.  
  5815.  The `hp500c` (*note hp500c:: ) terminal is similar to hpdj; hp500c
  5816.  additionally supports color and compression.
  5817.  
  5818.  
  5819. 
  5820. File: gnuplot.info, Node: hppj, Prev: hpljii, Up: terminal, Next: imagen
  5821.  
  5822.  The `hppj` terminal driver supports the HP PaintJet and HP3630 printers.  The
  5823.  only option is the choice of font.
  5824.  
  5825.  Syntax:
  5826.        set terminal hppj {FNT5X9 | FNT9X17 | FNT13X25}
  5827.  
  5828.  with the middle-sized font (FNT9X17) being the default.
  5829.  
  5830. 
  5831. File: gnuplot.info, Node: imagen, Prev: hppj, Up: terminal, Next: mif
  5832.  
  5833.  The `imagen` terminal driver supports Imagen laser printers.  It is capable
  5834.  of placing multiple graphs on a single page.
  5835.  
  5836.  Syntax:
  5837.        set terminal imagen {<fontsize>} {portrait | landscape}
  5838.                            {[<horiz>,<vert>]}
  5839.  
  5840.  where `fontsize` (*note fontsize:: ) defaults to 12 points and the layout
  5841.  defaults to landscape. `<horiz>` and `<vert>` are the number of graphs in the
  5842.  horizontal and vertical directions; these default to unity.
  5843.  
  5844.  Example:
  5845.        set terminal imagen portrait [2,3]
  5846.  
  5847.  puts six graphs on the page in three rows of two in portrait orientation.
  5848.  
  5849. 
  5850. File: gnuplot.info, Node: mif, Prev: imagen, Up: terminal, Next: pbm
  5851.  
  5852.  The `mif` terminal driver produces Frame Maker MIF format version 3.00.  It
  5853.  plots in MIF Frames with the size 15*10 cm, and plot primitives with the same
  5854.  pen will be grouped in the same MIF group.  Plot primitives in a `gnuplot`
  5855.  (*note gnuplot:: ) page will be plotted in a MIF Frame, and several MIF Frames
  5856.  are collected in one large MIF Frame.  The MIF font used for text is "Times".
  5857.  
  5858.  Several options may be set in the MIF 3.00 driver.
  5859.  
  5860.  Syntax:
  5861.        set terminal mif {colour | monochrome} {polyline | vectors}
  5862.                         {help | ?}
  5863.  
  5864.  `colour` plots lines with line types >= 0 in colour (MIF sep. 2--7) and
  5865.  `monochrome` plots all line types in black (MIF sep. 0).
  5866.  `polyline` plots curves as continuous curves and `vectors` plots curves as
  5867.  collections of vectors.
  5868.  `help` (*note help:: ) and ? print online help on standard error output---both
  5869.  print a short description of the usage; `help` also lists the options;
  5870.  
  5871.  Examples:
  5872.        set term mif colour polylines    # defaults
  5873.        set term mif                     # defaults
  5874.        set term mif vectors
  5875.        set term mif help
  5876.  
  5877. 
  5878. File: gnuplot.info, Node: pbm, Prev: mif, Up: terminal, Next: png
  5879.  
  5880.  Several options may be set in the `pbm` terminal---the driver for PBMplus.
  5881.  
  5882.  Syntax:
  5883.        set terminal pbm {<fontsize>} {<mode>}
  5884.  
  5885.  where <fontsize> is `small`, `medium`, or `large` and <mode> is `monochrome`,
  5886.  `gray` or `color`.  The default plot size is 640 pixels wide and 480 pixels
  5887.  high; this may be changed by `set size` (*note size:: ).
  5888.  
  5889.  The output of the `pbm` driver depends upon <mode>: `monochrome` produces a
  5890.  portable bitmap (one bit per pixel), `gray` a portable graymap (three bits
  5891.  per pixel) and `color` a portable pixmap (color, four bits per pixel).
  5892.  
  5893.  The output of this driver can be used with Jef Poskanzer's excellent PBMPLUS
  5894.  package, which provides programs to convert the above PBMPLUS formats to GIF,
  5895.  TIFF, MacPaint, Macintosh PICT, PCX, X11 bitmap and many others.  PBMPLUS may
  5896.  be obtained from ftp.x.org.  The relevant files have names that begin with
  5897.  "netpbm-1mar1994.p1"; they reside in /contrib/utilities.  The package can
  5898.  probably also be obtained from one of the many sites that mirrors ftp.x.org.
  5899.  
  5900.  Examples:
  5901.        set terminal pbm small monochrome             # defaults
  5902.        set size 2,2; set terminal pbm color medium
  5903.  
  5904. 
  5905. File: gnuplot.info, Node: png, Prev: pbm, Up: terminal, Next: postscript
  5906.  
  5907.  The `png` terminal driver supports Portable Network Graphics.  To compile it,
  5908.  you will need  the third-party libraries "libpng" and "zlib"; both are
  5909.  available at ftp://ftp.uu.net/graphics/png.  `png` has two options.
  5910.  
  5911.  Syntax:
  5912.        set terminal png {small | medium | large}
  5913.                         {monochrome | gray | color}
  5914.  
  5915.  The defaults are small (fontsize) and monochrome.  Default size of the output
  5916.  is 640*480 pixel.
  5917.  
  5918. 
  5919. File: gnuplot.info, Node: postscript, Prev: png, Up: terminal, Next: enhanced postscript
  5920.  
  5921.  Several options may be set in the `postscript` driver.
  5922.  
  5923.  Syntax:
  5924.        set terminal postscript {<mode>} {enhanced | noenhanced}
  5925.                                {color | monochrome} {solid | dashed}
  5926.                                {<duplexing>}
  5927.                                {"<fontname>"} {<fontsize>}
  5928.  
  5929.  where <mode> is `landscape`, `portrait`, `eps` or `default`;
  5930.  `solid` (*note solid:: ) draws all plots with solid lines, overriding any
  5931.  dashed patterns; <duplexing> is `defaultplex`, `simplex` or `duplex`
  5932.  ("duplexing" in PostScript is the ability of the printer to print on both
  5933.  sides of the same page---don't set this if your printer can't do it);
  5934.  `enhanced` activates the "enhanced PostScript" features (subscripts,
  5935.  superscripts and mixed fonts); `"<fontname>"` is the name of a valid
  5936.  PostScript font; and `<fontsize>` is the size of the font in PostScript
  5937.  points.
  5938.  
  5939.  `default` mode sets all options to their defaults: `landscape`, `monochrome`,
  5940.  `dashed`, `defaultplex`, `noenhanced`, "Helvetica" and 14pt.
  5941.   Default size of a PostScript plot is 10 inches wide and 7 inches high.
  5942.  
  5943.  `eps` mode generates EPS (Encapsulated PostScript) output, which is just
  5944.  regular PostScript with some additional lines that allow the file to be
  5945.  imported into a variety of other applications.  (The added lines are
  5946.  PostScript comment lines, so the file may still be printed by itself.)  To
  5947.  get EPS output, use the `eps` mode and make only one plot per file.  In `eps`
  5948.  mode the whole plot, including the fonts, is reduced to half of the default
  5949.  size.
  5950.  
  5951.  Examples:
  5952.        set terminal postscript default       # old postscript
  5953.        set terminal postscript enhanced      # old enhpost
  5954.        set terminal postscript landscape 22  # old psbig
  5955.        set terminal postscript eps 14        # old epsf1
  5956.        set terminal postscript eps 22        # old epsf2
  5957.        set size 0.7,1.4; set term post portrait color "Times-Roman" 14
  5958.  
  5959.  Linewidths and pointsizes may be changed with `set linestyle`
  5960.  (*note linestyle:: ).
  5961.  
  5962.  The `postscript` driver supports about 70 distinct pointtypes, selectable
  5963.  through the `pointtype` option on `plot` (*note plot:: ) and set linestyle.
  5964.  
  5965.  Several possibly useful files about `gnuplot` (*note gnuplot:: )'s PostScript
  5966.  are included in the /docs/ps subdirectory of the `gnuplot` distribution and at
  5967.  the distribution sites.  These are "ps_symbols.gpi" (a `gnuplot` command file
  5968.  that, when executed, creates the file "ps_symbols.ps" which shows all the
  5969.  symbols available through the `postscript` terminal), "ps_guide.ps" (a
  5970.  PostScript file that contains a summary of the enhanced syntax and a page
  5971.  showing what the octal codes produce with text and symbol fonts) and
  5972.  "ps_file.doc" (a text file that contains a discussion of the organization of a
  5973.  PostScript file written by `gnuplot`).
  5974.  
  5975.  A PostScript file is editable, so once `gnuplot` has created one, you are
  5976.  free to modify it to your heart's desire.  See the "editing postscript"
  5977.  section for some hints.
  5978.  
  5979. * Menu:
  5980.  
  5981. * enhanced postscript::
  5982. * editing postscript::
  5983.  
  5984. 
  5985. File: gnuplot.info, Node: enhanced postscript, Prev: postscript, Up: postscript, Next: editing postscript
  5986.  
  5987.   Control      Examples        Explanation
  5988.    ^           a^x             superscript
  5989.    _           a_x             subscript
  5990.    @           @x or a@^b_c    phantom box (occupies no width)
  5991.    &           &{space}        inserts space of specified length
  5992.  
  5993.  Braces can be used to place multiple-character text where a single character
  5994.  is expected (e.g., 2^{10}).  To change the font and/or size, use the full
  5995.  form:  {/[fontname][=fontsize | *fontscale] text}.  Thus {/Symbol=20 G} is a
  5996.  20-point GAMMA) and {/*0.75 K} is a K at three-quarters of whatever fontsize
  5997.  is currently in effect.  (The '/' character MUST be the first character after
  5998.  the '{'.)
  5999.  
  6000.  If the encoding vector has been changed by `set encoding` (*note encoding:: ),
  6001.  the default encoding vector can be used instead by following the slash with a
  6002.  dash.  This is unnecessary if you use the Symbol font, however---since /Symbol
  6003.  uses its own encoding vector, `gnuplot` (*note gnuplot:: ) will not apply any
  6004.  other encoding vector to it.
  6005.  
  6006.  The phantom box is useful for a@^b_c to align superscripts and subscripts
  6007.  but does not work well for overwriting an accent on a letter.  (To do the
  6008.  latter, it is much better to use `set encoding iso_8859_1` to change to the
  6009.  ISO Latin-1 encoding vector, which contains a large variety of letters with
  6010.  accents or other diacritical marks.)  Since the box is non-spacing, it is
  6011.  sensible to put the shorter of the subscript or superscript in the box (that
  6012.  is, after the @).
  6013.  
  6014.  Space equal in length to a string can be inserted using the '&' character.
  6015.  Thus
  6016.          'abc&{def}ghi'
  6017.  would produce
  6018.          'abc   ghi'.
  6019.  
  6020.  You can access special symbols numerically by specifying \character-code (in
  6021.  octal), e.g., {/Symbol \245} is the symbol for infinity.
  6022.  
  6023.  You can escape control characters using \, e.g.,  \\, \{, and so on.
  6024.  
  6025.  But be aware that strings in double-quotes are parsed differently than those
  6026.  enclosed in single-quotes.  The major difference is that backslashes may need
  6027.  to be doubled when in double-quoted strings.
  6028.  
  6029.  Examples (these are hard to describe in words---try them!):
  6030.        set xlabel 'Time (10^6 {/Symbol m}s)'
  6031.        set title '{/Symbol=18 \362@_{/=9.6 0}^{/=12 x}} \
  6032.                   {/Helvetica e^{-{/Symbol m}^2/2} d}{/Symbol m}'
  6033.  
  6034.  The file "ps_guide.ps" in the /docs/ps subdirectory of the `gnuplot` source
  6035.  distribution contains more examples of the enhanced syntax.
  6036.  
  6037. 
  6038. File: gnuplot.info, Node: editing postscript, Prev: enhanced postscript, Up: postscript
  6039.  
  6040.  The PostScript language is a very complex language---far too complex to
  6041.  describe in any detail in this document.  Nevertheless there are some things
  6042.  in a PostScript file written by `gnuplot` (*note gnuplot:: ) that can be
  6043.  changed without risk of introducing fatal errors into the file.
  6044.  
  6045.  For example, the PostScript statement "/Color true def" (written into the
  6046.  file in response to the command `set terminal postscript color`), may be
  6047.  altered in an obvious way to generate a black-and-white version of a plot.
  6048.  Similarly line colors, text colors, line weights and symbol sizes can also be
  6049.  altered in straight-forward ways.  Text (titles and labels) can be edited to
  6050.  correct misspellings or to change fonts.  Anything can be repositioned, and
  6051.  of course anything can be added or deleted, but modifications such as these
  6052.  may require deeper knowledge of the PostScript language.
  6053.  
  6054.  The organization of a PostScript file written by `gnuplot` is discussed in
  6055.  the text file "ps_file.doc" in the /docs/ps subdirectory.
  6056.  
  6057. 
  6058. File: gnuplot.info, Node: qms, Prev: postscript, Up: terminal, Next: table
  6059.  
  6060.  The `qms` terminal driver supports the QMS/QUIC Laser printer, the Talaris
  6061.  1200 and others.  It has no options.
  6062.  
  6063. 
  6064. File: gnuplot.info, Node: table, Prev: qms, Up: terminal, Next: tgif
  6065.  
  6066.  Instead of producing a graph, the `table` terminal prints out the points on
  6067.  which a graph would be based, i.e., the results of processing the `plot`
  6068.  (*note plot:: ) or `splot` (*note splot:: ) command, in a multicolumn ASCII
  6069.  table of X Y {Z} R values.  The character R takes on one of three values: "i"
  6070.  if the point is in the active range, "o" if it is out-of-range, or "u" if it
  6071.  is undefined.  The data format is determined by the format of the axis labels
  6072.  (see `set format` (*note format:: )).
  6073.  
  6074.  For those times when you want the numbers, you can display them on the
  6075.  screen or save them to a file.  This can be useful if you want to generate
  6076.  contours and then save them for further use, perhaps for plotting with
  6077.  `plot`;  see `set contour` (*note contour:: ) for an example.  The same method
  6078.  can be used to save interpolated data (see `set samples` (*note samples:: )
  6079.  and  `set dgrid3d` (*note dgrid3d:: )).
  6080.  
  6081.  
  6082. 
  6083. File: gnuplot.info, Node: tgif, Prev: table, Up: terminal, Next: tkcanvas
  6084.  
  6085.  Tgif is an X11-based drawing tool---it has nothing to do with GIF.
  6086.  
  6087.  The `tgif` driver supports different pointsizes (with `set pointsize`
  6088.  (*note pointsize:: )), different label fonts and font sizes (e.g. `set label
  6089.  "Hallo" at x,y font "Helvetica,34"`) and multiple graphs on the page.  The
  6090.  proportions of the axes are not changed.
  6091.  
  6092.  Syntax:
  6093.        set terminal tgif {portrait | landscape} {<[x,y]>}
  6094.                          {solid | dashed}
  6095.                          {"<fontname>"} {<fontsize>}
  6096.  
  6097.  where <[x,y]> specifies the number of graphs in the x and y directions on the
  6098.  page, "<fontname>" is the name of a valid PostScript font, and <fontsize>
  6099.  specifies the size of the PostScript font.  Defaults are `portrait`, `[1,1]`,
  6100.  `dashed`, `"Helvetica"`, and `18`.
  6101.  
  6102.  The `solid` (*note solid:: ) option is usually prefered if lines are colored,
  6103.  as they often are in the editor.  Hardcopy will be black-and-white, so
  6104.  `dashed` should be chosen for that.
  6105.  
  6106.  Multiplot is implemented in two different ways.
  6107.  
  6108.  The first multiplot implementation is the standard gnuplot multiplot feature:
  6109.  
  6110.        set terminal tgif
  6111.        set output "file.obj"
  6112.        set multiplot
  6113.        set origin x01,y01
  6114.        set size  xs,ys
  6115.        plot ...
  6116.             ...
  6117.        set origin x02,y02
  6118.        plot ...
  6119.        set nomultiplot
  6120.  
  6121.  See `set multiplot` (*note multiplot:: ) for further information.
  6122.  
  6123.  The second version is the [x,y] option for the driver itself.  The advantage
  6124.  of this implementation is that everything is scaled and placed automatically
  6125.  without the need for setting origins and sizes; the graphs keep their natural
  6126.  x/y proportions of 3/2 (or whatever is fixed by `set size` (*note size:: )).
  6127.  
  6128.  If both multiplot methods are selected, the standard method is chosen and a
  6129.  warning message is given.
  6130.  
  6131.  Examples of single plots (or standard multiplot):
  6132.        set terminal tgif                  # defaults
  6133.        set terminal tgif "Times-Roman" 24
  6134.        set terminal tgif landscape
  6135.        set terminal tgif landscape solid
  6136.  
  6137.  Examples using the built-in multiplot mechanism:
  6138.        set terminal tgif portrait [2,4]  # portrait; 2 plots in the x-
  6139.                                          # and 4 in the y-direction
  6140.        set terminal tgif [1,2]           # portrait; 1 plot in the x-
  6141.                                          # and 2 in the y-direction
  6142.        set terminal tgif landscape [3,3] # landscape; 3 plots in both
  6143.                                          # directions
  6144.  
  6145. 
  6146. File: gnuplot.info, Node: tkcanvas, Prev: tgif, Up: terminal, Next: epson-180dpi
  6147.  
  6148.  This terminal driver generates Tk canvas widget commands based on Tcl/Tk
  6149.  (default) or Perl.  To use it, rebuild `gnuplot` (*note gnuplot:: ) (after
  6150.  uncommenting or inserting the appropriate line in "term.h"), then
  6151.  
  6152.   gnuplot> set term tkcanvas {perltk} {interactive}
  6153.   gnuplot> set output 'plot.file'
  6154.  
  6155.  After invoking "wish", execute the following sequence of Tcl/Tk commands:
  6156.  
  6157.   % source plot.file
  6158.   % canvas .c
  6159.   % pack .c
  6160.   % gnuplot .c
  6161.  
  6162.  Or, for Perl/Tk use a program like this:
  6163.  
  6164.   use Tk;
  6165.   my $top = MainWindow->new;
  6166.   my $c = $top->Canvas;
  6167.   $c->pack();
  6168.   do "plot.pl";
  6169.   gnuplot->($c);
  6170.   MainLoop;
  6171.  
  6172.  The code generated by `gnuplot` creates a procedure called "gnuplot"
  6173.  that takes the name of a canvas as its argument.  When the procedure is
  6174.  called, it clears the canvas, finds the size of the canvas and draws the plot
  6175.  in it, scaled to fit.
  6176.  
  6177.  For 2-dimensional plotting (`plot` (*note plot:: )) two additional procedures
  6178.  are defined: "gnuplot_plotarea" will return a list containing the borders of
  6179.  the plotting area "xleft, xright, ytop, ybot" in canvas screen coordinates,
  6180.  while the ranges of the two axes "x1min, x1max, y1min, y1max, x2min, x2max,
  6181.  y2min, y2max" in plot coordinates can be obtained calling
  6182.  "gnuplot_axisranges". If the "interactive" option is specified, mouse clicking
  6183.  on a line segment will print the coordinates of its midpoint to
  6184.  stdout. Advanced actions can happen instead if the user supplies a procedure
  6185.  named "user_gnuplot_coordinates", which takes the following arguments: "win id
  6186.  x1s y1s x2s y2s x1e y1e x2e y2e x1m y1m x2m y2m", the name of the canvas and
  6187.  the id of the line segment followed by the coordinates of its start and end
  6188.  point in the two possible axis ranges; the coordinates of the midpoint are
  6189.  only filled for logarithmic axes.
  6190.  
  6191.  The current version of `tkcanvas` supports neither `multiplot`
  6192.  (*note multiplot:: ) nor  `replot` (*note replot:: ).
  6193.  
  6194.  
  6195. 
  6196. File: gnuplot.info, Node: epson-180dpi, Prev: tkcanvas, Up: terminal, Next: latex
  6197.  
  6198.  This driver supports a family of Epson printers and derivatives.
  6199.  
  6200.  `epson-180dpi` and `epson-60dpi` are drivers for Epson LQ-style 24-pin
  6201.  printers with resolutions of 180 and 60 dots per inch, respectively.
  6202.  
  6203.  `epson-lx800` is a generic 9-pin driver appropriate for printers like the
  6204.  Epson LX-800, the Star NL-10 and NX-1000, the PROPRINTER, and so forth.
  6205.  
  6206.  `nec-cp6` is generix 24-pin driver that can be used for printers like the
  6207.  NEC CP6 and the Epson LQ-800.
  6208.  
  6209.  The `okidata` driver supports the 9-pin OKIDATA 320/321 Standard printers.
  6210.  
  6211.  The `starc` driver is for the Star Color Printer.
  6212.  
  6213.  The `tandy-60dpi` driver is for the Tandy DMP-130 series of 9-pin, 60-dpi
  6214.  printers.
  6215.  
  6216.  Only `nec-cp6` has any options.
  6217.  
  6218.  Syntax:
  6219.        set terminal nec-cp6 {monochrome | colour | draft}
  6220.  
  6221.  which defaults to monochrome.
  6222.  
  6223.  With each of these drivers, a binary copy is required on a PC to print.  Do
  6224.  not use `print` (*note print:: )---use instead copy file /b lpt1:.
  6225.  
  6226.  
  6227. 
  6228. File: gnuplot.info, Node: latex, Prev: epson-180dpi, Up: terminal, Next: pslatex and pstex
  6229.  
  6230.  The `latex` and `emtex` drivers allow two options.
  6231.  
  6232.  Syntax:
  6233.        set terminal latex | emtex {courier | roman | default} {<fontsize>}
  6234.  
  6235.  `fontsize` (*note fontsize:: ) may be any size you specify.  The default is
  6236.  for the plot to inherit its font setting from the embedding document.
  6237.  
  6238.  Unless your driver is capable of building fonts at any size (e.g. dvips),
  6239.  stick to the standard 10, 11 and 12 point sizes.
  6240.  
  6241.  METAFONT users beware: METAFONT does not like odd sizes.
  6242.  
  6243.  All drivers for LaTeX offer a special way of controlling text positioning:
  6244.  If any text string begins with '{', you also need to include a '}' at the
  6245.  end of the text, and the whole text will be centered both horizontally and
  6246.  vertically.  If the text string begins with '[', you need to follow this with
  6247.  a position specification (up to two out of t,b,l,r), ']{', the text itself,
  6248.  and finally '}'.  The text itself may be anything LaTeX can typeset as an
  6249.  LR-box.  '\rule{}{}'s may help for best positioning.
  6250.  
  6251.  Points, among other things, are drawn using the LaTeX commands "\Diamond" and
  6252.  "\Box".  These commands no longer belong to the LaTeX2e core; they are included
  6253.  in the latexsym package, which is part of the base distribution and thus part
  6254.  of any LaTeX implementation.  Please do not forget to use this package.
  6255.  
  6256.  Points are drawn with the LaTex commands \Diamond and \Box.  These
  6257.  commands do no longer belong to the LaTeX2e core, but are included in the
  6258.  latexsym-package in the base distribution, and are hence part of all LaTeX
  6259.  implementations. Please do not forget to use this package.
  6260.  
  6261.  Examples:
  6262.  About label positioning:
  6263.  Use gnuplot defaults (mostly sensible, but sometimes not really best):
  6264.         set title '\LaTeX\ -- $ \gamma $'
  6265.  Force centering both horizontally and vertically:
  6266.         set label '{\LaTeX\ -- $ \gamma $}' at 0,0
  6267.  Specify own positioning (top here):
  6268.         set xlabel '[t]{\LaTeX\ -- $ \gamma $}'
  6269.  The other label -- account for long ticlabels:
  6270.         set ylabel '[r]{\LaTeX\ -- $ \gamma $\rule{7mm}{0pt}'
  6271.  
  6272. 
  6273. File: gnuplot.info, Node: pslatex and pstex, Prev: latex, Up: terminal, Next: eepic
  6274.  
  6275.  The `pslatex` and `pstex` drivers generate output for further processing by
  6276.  LaTeX and TeX, respectively.  Figures generated by `pstex` can be included
  6277.  in any plain-based format (including LaTeX).
  6278.  
  6279.  Syntax:
  6280.        set terminal pslatex | |pstex {<color>} {<dashed>} {<rotate>}
  6281.                                      {auxfile} {<font_size>}
  6282.  
  6283.  <color> is either `color` or `monochrome`.  <rotate> is either `rotate`
  6284.  (*note rotate:: ) or `norotate` and determines if the y-axis label is
  6285.  rotated.  <font_size> is used to scale the font from its usual size.
  6286.  
  6287.  If `auxfile` is specified, it directs the driver to put the PostScript
  6288.  commands into an auxiliary file instead of directly into the LaTeX file.
  6289.  This is useful if your pictures are large enough that dvips cannot handle
  6290.  them.  The name of the auxiliary PostScript file is derived from the name of
  6291.  the TeX file given on the `set output` (*note output:: ) command; it is
  6292.  determined by replacing the trailing `.tex` (actually just the final extent in
  6293.  the file name) with `.ps` in the output file name, or, if the TeX file has no
  6294.  extension, `.ps` is appended.  Remember to close the file before leaving
  6295.  `gnuplot` (*note gnuplot:: ).
  6296.  
  6297.  All drivers for LaTeX offer a special way of controlling text positioning:
  6298.  If any text string begins with '{', you also need to include a '}' at the
  6299.  end of the text, and the whole text will be centered both horizontally
  6300.  and vertically by LaTeX. --- If the text string begins with '[', you need
  6301.  to continue it with: a position specification (up to two out of t,b,l,r),
  6302.  ']{', the text itself, and finally, '}'. The text itself may be anything
  6303.  LaTeX can typeset as an LR-box. \rule{}{}'s may help for best positioning.
  6304.  
  6305.  Examples:
  6306.        set term pslatex monochrome dashed rotate       # set to defaults
  6307.  To write the PostScript commands into the file "foo.ps":
  6308.        set term pslatex auxfile
  6309.        set output "foo.tex"; plot ...: set output
  6310.  About label positioning:
  6311.  Use gnuplot defaults (mostly sensible, but sometimes not really best):
  6312.         set title '\LaTeX\ -- $ \gamma $'
  6313.  Force centering both horizontally and vertically:
  6314.         set label '{\LaTeX\ -- $ \gamma $}' at 0,0
  6315.  Specify own positioning (top here):
  6316.         set xlabel '[t]{\LaTeX\ -- $ \gamma $}'
  6317.  The other label -- account for long ticlabels:
  6318.         set ylabel '[r]{\LaTeX\ -- $ \gamma $\rule{7mm}{0pt}'
  6319.  
  6320.  Linewidths and pointsizes may be changed with `set linestyle`
  6321.  (*note linestyle:: ).
  6322.  
  6323.  
  6324. 
  6325. File: gnuplot.info, Node: eepic, Prev: pslatex and pstex, Up: terminal, Next: tpic
  6326.  
  6327.  The `eepic` terminal driver supports the extended LaTeX picture environment.
  6328.  It is an alternative to the `latex` (*note latex:: ) driver.
  6329.  
  6330.  The output of this terminal is intended for use with the "eepic.sty" macro
  6331.  package for LaTeX.  To use it, you need "eepic.sty", "epic.sty" and a
  6332.  printer driver that supports the "tpic" \specials.  If your printer driver
  6333.  doesn't support those \specials, "eepicemu.sty" will enable you to use some
  6334.  of them.
  6335.  
  6336.  Although dotted and dashed lines are possible with `eepic` and are tempting,
  6337.  they do not work well for high-sample-rate curves, fusing the dashes all
  6338.  together into a solid line.  For now, the `eepic` driver creates only solid
  6339.  lines.  There is another gnuplot driver (`tpic` (*note tpic:: )) that supports
  6340.  dashed lines, but it cannot be used if your DVI driver doesn't support "tpic"
  6341.  \specials.
  6342.  
  6343.  All drivers for LaTeX offer a special way of controlling text positioning:
  6344.  If any text string begins with '{', you also need to include a '}' at the
  6345.  end of the text, and the whole text will be centered both horizontally
  6346.  and vertically by LaTeX. --- If the text string begins with '[', you need
  6347.  to continue it with: a position specification (up to two out of t,b,l,r),
  6348.  ']{', the text itself, and finally, '}'. The text itself may be anything
  6349.  LaTeX can typeset as an LR-box. \rule{}{}'s may help for best positioning.
  6350.  
  6351.  The `eepic` terminal has no options.
  6352.  
  6353.  Examples:
  6354.  About label positioning:
  6355.  Use gnuplot defaults (mostly sensible, but sometimes not really best):
  6356.         set title '\LaTeX\ -- $ \gamma $'
  6357.  Force centering both horizontally and vertically:
  6358.         set label '{\LaTeX\ -- $ \gamma $}' at 0,0
  6359.  Specify own positioning (top here):
  6360.         set xlabel '[t]{\LaTeX\ -- $ \gamma $}'
  6361.  The other label -- account for long ticlabels:
  6362.         set ylabel '[r]{\LaTeX\ -- $ \gamma $\rule{7mm}{0pt}'
  6363.  
  6364. 
  6365. File: gnuplot.info, Node: tpic, Prev: eepic, Up: terminal, Next: pstricks
  6366.  
  6367.  The `tpic` terminal driver supports the LaTeX picture environment with tpic
  6368.  \specials.  It is an alternative to the `latex` (*note latex:: ) and  `eepic`
  6369.  (*note eepic:: ) terminal drivers. Options are the point size, line width, and
  6370.  dot-dash interval.
  6371.  
  6372.  Syntax:
  6373.        set terminal tpic <pointsize> <linewidth> <interval>
  6374.  
  6375.  where `pointsize` (*note pointsize:: ) and  `linewidth` (*note linewidth:: )
  6376.  are integers in milli-inches and interval is a float in inches.  If a
  6377.  non-positive value is specified, the default is chosen: pointsize = 40,
  6378.  linewidth = 6, interval = 0.1.
  6379.  
  6380.  All drivers for LaTeX offer a special way of controlling text positioning:
  6381.  If any text string begins with '{', you also need to include a '}' at the
  6382.  end of the text, and the whole text will be centered both horizontally
  6383.  and vertically by LaTeX. --- If the text string begins with '[', you need
  6384.  to continue it with: a position specification (up to two out of t,b,l,r),
  6385.  ']{', the text itself, and finally, '}'. The text itself may be anything
  6386.  LaTeX can typeset as an LR-box. \rule{}{}'s may help for best positioning.
  6387.  
  6388.  Examples:
  6389.  About label positioning:
  6390.  Use gnuplot defaults (mostly sensible, but sometimes not really best):
  6391.         set title '\LaTeX\ -- $ \gamma $'
  6392.  Force centering both horizontally and vertically:
  6393.         set label '{\LaTeX\ -- $ \gamma $}' at 0,0
  6394.  Specify own positioning (top here):
  6395.         set xlabel '[t]{\LaTeX\ -- $ \gamma $}'
  6396.  The other label -- account for long ticlabels:
  6397.         set ylabel '[r]{\LaTeX\ -- $ \gamma $\rule{7mm}{0pt}'
  6398.  
  6399. 
  6400. File: gnuplot.info, Node: pstricks, Prev: tpic, Up: terminal, Next: texdraw
  6401.  
  6402.  The `pstricks` driver is intended for use with the "pstricks.sty" macro
  6403.  package for LaTeX.  It is an alternative to the `eepic` (*note eepic:: ) and
  6404.   `latex` (*note latex:: ) drivers. You need "pstricks.sty", and, of course, a
  6405.  printer that understands PostScript, or a converter such as Ghostscript.
  6406.  
  6407.  PSTricks is available via anonymous ftp from the /pub directory at
  6408.  Princeton.EDU.  This driver definitely does not come close to using the full
  6409.  capability of the PSTricks package.
  6410.  
  6411.  Syntax:
  6412.        set terminal pstricks {hacktext | nohacktext} {unit | nounit}
  6413.  
  6414.  The first option invokes an ugly hack that gives nicer numbers; the second
  6415.  has to do with plot scaling.  The defaults are `hacktext` and `nounit`.
  6416.  
  6417. 
  6418. File: gnuplot.info, Node: texdraw, Prev: pstricks, Up: terminal, Next: mf
  6419.  
  6420.  The `texdraw` terminal driver supports the LaTeX texdraw environment.  It is
  6421.  intended for use with "texdraw.sty" and "texdraw.tex" in the texdraw package.
  6422.  
  6423.  It has no options.
  6424.  
  6425. 
  6426. File: gnuplot.info, Node: mf, Prev: texdraw, Up: terminal, Next: METAFONT Instructions
  6427.  
  6428.  The `mf` terminal driver creates a input file to the METAFONT program.  Thus a
  6429.  figure may be used in the TeX document in the same way as is a character.
  6430.  
  6431.  To use a picture in a document, the METAFONT program must be run with the
  6432.  output file from `gnuplot` (*note gnuplot:: ) as input.  Thus, the user needs
  6433.  a basic knowledge of the font creating process and the procedure for including
  6434.  a new font in a document.  However, if the METAFONT program is set up properly
  6435.  at the local site, an unexperienced user could perform the operation without
  6436.  much trouble.
  6437.  
  6438.  The text support is based on a METAFONT character set.  Currently the
  6439.  Computer Modern Roman font set is input, but the user is in principal free to
  6440.  chose whatever fonts he or she needs.  The METAFONT source files for the
  6441.  chosen font must be available.  Each character is stored in a separate
  6442.  picture variable in METAFONT.  These variables may be manipulated (rotated,
  6443.  scaled etc.) when characters are needed.  The drawback is the interpretation
  6444.  time in the METAFONT program.  On some machines (i.e. PC) the limited amount
  6445.  of memory available may also cause problems if too many pictures are stored.
  6446.  
  6447.  The `mf` terminal has no options.
  6448.  
  6449. * Menu:
  6450.  
  6451. * METAFONT Instructions::
  6452.  
  6453. 
  6454. File: gnuplot.info, Node: METAFONT Instructions, Prev: mf, Up: mf
  6455.  
  6456.  
  6457.  - Set your terminal to METAFONT:
  6458.    set terminal mf
  6459.  - Select an output-file, e.g.:
  6460.    set output "myfigures.mf"
  6461.  - Create your pictures. Each picture will generate a separate character. Its
  6462.  default size will be 5*3 inches. You can change the size by saying `set size
  6463.  0.5,0.5` or whatever fraction of the default size you want to have.
  6464.  
  6465.  - Quit `gnuplot` (*note gnuplot:: ).
  6466.  
  6467.  - Generate a TFM and GF file by running METAFONT on the output of `gnuplot`.
  6468.  Since the picture is quite large (5*3 in), you will have to use a version of
  6469.  METAFONT that has a value of at least 150000 for memmax.  On Unix systems
  6470.  these are conventionally installed under the name bigmf.  For the following
  6471.  assume that the command virmf stands for a big version of METAFONT.  For
  6472.  example:
  6473.  
  6474.  - Invoke METAFONT:
  6475.      virmf '&plain'
  6476.  - Select the output device: At the METAFONT prompt ('*') type:
  6477.      \mode:=CanonCX;     % or whatever printer you use
  6478.  - Optionally select a magnification:
  6479.      mag:=1;             % or whatever you wish
  6480.  - Input the `gnuplot`-file:
  6481.      input myfigures.mf
  6482.  On a typical Unix machine there will usually be a script called "mf" that
  6483.  executes virmf '&plain', so you probably can substitute mf for virmf &plain.
  6484.  This will generate two files: mfput.tfm and mfput.$$$gf (where $$$ indicates
  6485.  the resolution of your device).  The above can be conveniently achieved by
  6486.  typing everything on the command line, e.g.:
  6487.  virmf '&plain' '\mode:=CanonCX; mag:=1; input myfigures.mf'
  6488.  In this case the output files will be named myfigures.tfm and
  6489.  myfigures.300gf.
  6490.  
  6491.  - Generate a PK file from the GF file using gftopk:
  6492.    gftopk myfigures.300gf myfigures.300pk
  6493.  The name of the output file for gftopk depends on the DVI driver you use.
  6494.  Ask your local TeX administrator about the naming conventions.  Next, either
  6495.  install the TFM and PK files in the appropriate directories, or set your
  6496.  environment variables properly.  Usually this involves setting TEXFONTS to
  6497.  include the current directory and doing the same thing for the environment
  6498.  variable that your DVI driver uses (no standard name here...).  This step is
  6499.  necessary so that TeX will find the font metric file and your DVI driver will
  6500.  find the PK file.
  6501.  
  6502.  - To include your pictures in your document you have to tell TeX the font:
  6503.    \font\gnufigs=myfigures
  6504.  Each picture you made is stored in a single character.  The first picture is
  6505.  character 0, the second is character 1, and so on...  After doing the above
  6506.  step, you can use the pictures just like any other characters.  Therefore, to
  6507.  place pictures 1 and 2 centered in your document, all you have to do is:
  6508.    \centerline{\gnufigs\char0}
  6509.    \centerline{\gnufigs\char1}
  6510.  in plain TeX.  For LaTeX you can, of course, use the picture environment and
  6511.  place the picture wherever you wish by using the \makebox and \put macros.
  6512.  
  6513.  This conversion saves you a lot of time once you have generated the font;
  6514.  TeX handles the pictures as characters and uses minimal time to place them,
  6515.  and the documents you make change more often than the pictures do.  It also
  6516.  saves a lot of TeX memory.  One last advantage of using the METAFONT driver
  6517.  is that the DVI file really remains device independent, because no \special
  6518.  commands are used as in the eepic and tpic drivers.
  6519.  
  6520. 
  6521. File: gnuplot.info, Node: mp, Prev: mf, Up: terminal, Next: Metapost Instructions
  6522.  
  6523.  
  6524.  The `mp` driver produces output intended to be input to the Metapost program.
  6525.  Running Metapost on the file creates EPS files containing the plots. By
  6526.  default, Metapost passes all text through TeX.  This has the advantage of
  6527.  allowing essentially  any TeX symbols in titles and labels.
  6528.  
  6529.  The `mp` terminal is selected with a command of the form
  6530.     set term mp {color} {solid} {notex} {mag <magsize>} {"<name>"} {<size>}
  6531.  The option `color` causes lines to be drawn in color (on a printer or display
  6532.  that supports it), `monochrome` (or nothing) selects black lines.  The option
  6533.  `solid` (*note solid:: ) draws solid lines, while dashed (or nothing) selects
  6534.  lines with different patterns of dashes.  If `solid` is selected but `color`
  6535.  is not, nearly all lines will be identical.  This may occasionally be useful,
  6536.  so it is allowed.
  6537.  
  6538.  The option `notex` bypasses TeX entirely, therefore no TeX code can be used in
  6539.  labels under this option.  This is intended for use on old plot files or files
  6540.  that make frequent use of common characters like `$` and `%` that require
  6541.  special handling in TeX.
  6542.  
  6543.  Changing font sizes in TeX has no effect on the size of mathematics, and there
  6544.  is no foolproof way to make such a change, except by globally  setting a
  6545.  magnification factor. This is the purpose of the `magnification` option. It
  6546.  must be followed by a scaling factor. All text (NOT the graphs) will be scaled
  6547.  by this factor. Use this if you have math that you want at some size other
  6548.  than the default 10pt. Unfortunately, all math will be the same size, but see
  6549.  the discussion below on editing the MP output. `mag` will also work under
  6550.  `notex` but there seems no point in using it as the font size option (below)
  6551.  works as well.
  6552.  
  6553.  A name in quotes selects the font that will be used when no explicit font is
  6554.  given in a `set label` (*note label:: ) or  `set title` (*note title:: ).  A
  6555.  name recognized by TeX (a TFM file exists) must be used.  The default is
  6556.  "cmr10" unless `notex` is selected, then it is "pcrr8r" (Courier).  Even under
  6557.  `notex`, a TFM file is needed by Metapost. The file `pcrr8r.tfm` is the name
  6558.  given to Courier in LaTeX's psnfss package.  If you change the font from the
  6559.  `notex` default, choose a font that matches the ASCII encoding at least in the
  6560.  range 32-126.  `cmtt10` almost works, but it has a nonblank character in
  6561.  position 32 (space).
  6562.  
  6563.  The size can be any number between 5.0 and 99.99.  If it is omitted, 10.0 is
  6564.  used.  It is advisable to use `magstep` sizes: 10 times an integer or
  6565.  half-integer power of 1.2, rounded to two decimals, because those are the most
  6566.  available sizes of fonts in TeX systems.
  6567.  
  6568.  All the options are optional.  If font information is given, it must be at the
  6569.  end, with size (if present) last.  The size is needed to select a size for the
  6570.  font, even if the font name includes size information.  For example,
  6571.  `set term mp "cmtt12"` selects cmtt12 shrunk to the default size 10.  This
  6572.  is probably not what you want or you would have used cmtt10.
  6573.  
  6574.  The following common ascii characters need special treatment in TeX:
  6575.     $, &, #, %, _;  |, <, >;  ^, ~,  \, {, and }
  6576.  The five characters $, #, &, _, and % can simply be escaped, e.g., `\$`.
  6577.  The three characters <, >, and | can be wrapped in math mode, e.g., `$<$`.
  6578.  The remainder require some TeX work-arounds.  Any good book on TeX will give
  6579.  some guidance.
  6580.  
  6581.  If you type your labels inside double quotes, backslashes in TeX code need to
  6582.  be escaped (doubled). Using single quotes will avoid having to do this, but
  6583.  then you cannot use `\n` for line breaks.  As of this writing, version 3.7 of
  6584.  gnuplot processess titles given in a `plot` (*note plot:: ) command
  6585.  differently than in other places, and backslashes in TeX commands need to be
  6586.  doubled regardless of the style of quotes.
  6587.  
  6588.  Metapost pictures are typically used in TeX documents.  Metapost deals with
  6589.  fonts pretty much the same way TeX does, which is different from most other
  6590.  document preparation programs.  If the picture is included in a LaTeX document
  6591.  using the graphics package, or in a plainTeX document via epsf.tex, and then
  6592.  converted to PostScript with dvips (or other dvi-to-ps converter), the text in
  6593.  the plot will usually be handled correctly.  However, the text may not appear
  6594.  if you send the Metapost output as-is to a PostScript interpreter.
  6595.  
  6596.  
  6597. * Menu:
  6598.  
  6599. * Metapost Instructions::
  6600.  
  6601. 
  6602. File: gnuplot.info, Node: Metapost Instructions, Prev: mp, Up: mp
  6603.  
  6604.  
  6605.  - Set your terminal to Metapost, e.g.:
  6606.     set terminal mp mono "cmtt12" 12
  6607.  
  6608.  - Select an output-file, e.g.:
  6609.     set output "figure.mp"
  6610.  
  6611.  - Create your pictures.  Each plot (or multiplot group) will generate a
  6612.  separate Metapost beginfig...endfig group.  Its default size will be 5 by 3
  6613.  inches.  You can change the size by saying `set size 0.5,0.5` or whatever
  6614.  fraction of the default size you want to have.
  6615.  
  6616.  - Quit gnuplot.
  6617.  
  6618.  - Generate EPS files by running Metapost on the output of gnuplot:
  6619.     mpost figure.mp  OR  mp figure.mp
  6620.  The name of the Metapost program depends on the system, typically `mpost` for
  6621.  a Unix machine and `mp` (*note mp:: ) on many others.  Metapost will generate
  6622.  one EPS file for each picture.
  6623.  
  6624.  - To include your pictures in your document you can use the graphics package
  6625.  in LaTeX or epsf.tex in plainTeX:
  6626.     \usepackage{graphics} % LaTeX
  6627.     \input epsf.tex       % plainTeX
  6628.  If you use a driver other than dvips for converting TeX DVI output to PS, you
  6629.  may need to add the following line in your LaTeX document:
  6630.     \DeclareGraphicsRule{*}{eps}{*}{}
  6631.  Each picture you made is in a separate file.  The first picture is in, e.g.,
  6632.  figure.0, the second in figure.1, and so on....  To place the third picture in
  6633.  your document, for example, all you have to do is:
  6634.     \includegraphics{figure.2} % LaTeX
  6635.     \epsfbox{figure.2}         % plainTeX
  6636.  
  6637.  The advantage, if any, of the mp terminal over a postscript terminal is
  6638.  editable output.  Considerable effort went into making this output as clean as
  6639.  possible.  For those knowledgeable in the Metapost language, the default line
  6640.  types and colors can be changed by editing the arrays `lt[]` and `col[]`.
  6641.  The choice of solid vs dashed lines, and color vs black lines can be change by
  6642.  changing the values assigned to the booleans `dashedlines` and `colorlines`.
  6643.  If the default `tex` option was in effect, global changes to the text of
  6644.  labels can be achieved by editing the `vebatimtex...etex` block.  In
  6645.  particular, a LaTeX preamble can be added if desired, and then LaTeX's
  6646.  built-in size changing commands can be used for maximum flexibility. Be sure
  6647.  to set the appropriate MP configuration variable to force Metapost to run
  6648.  LaTeX instead of plainTeX.
  6649.  
  6650. 
  6651. File: gnuplot.info, Node: tics, Prev: terminal, Up: set-show, Next: ticslevel
  6652.  
  6653.  The `set tics` command can be used to change the tics to be drawn outwards.
  6654.  
  6655.  Syntax:
  6656.        set tics {<direction>}
  6657.        show tics
  6658.  
  6659.  where <direction> may be `in` (the default) or `out`.
  6660.  
  6661.  See also `set xtics` (*note xtics:: ) for more control of major (labelled) tic
  6662.  marks and set mxtics` for control of minor tic marks.
  6663.  
  6664.  
  6665. 
  6666. File: gnuplot.info, Node: ticslevel, Prev: tics, Up: set-show, Next: ticscale
  6667.  
  6668.  Using `splot` (*note splot:: ), one can adjust the relative height of the
  6669.  vertical (Z) axis using `set ticslevel`.  The numeric argument provided
  6670.  specifies the location of the bottom of the scale (as a fraction of the
  6671.  z-range) above the xy-plane. The default value is 0.5.  Negative values are
  6672.  permitted, but tic labels on the three axes may overlap.
  6673.  
  6674.  To place the xy-plane at a position 'pos' on the z-axis, `ticslevel` should
  6675.  be set equal to  (pos - zmin) / (zmin - zmax).
  6676.  
  6677.  Syntax:
  6678.        set ticslevel {<level>}
  6679.        show tics
  6680.  
  6681.  See also `set view` (*note view:: ).
  6682.  
  6683.  
  6684. 
  6685. File: gnuplot.info, Node: ticscale, Prev: ticslevel, Up: set-show, Next: timestamp
  6686.  
  6687.  The size of the tic marks can be adjusted with `set ticscale`.
  6688.  
  6689.  Syntax:
  6690.        set ticscale {<major> {<minor>}}
  6691.        show tics
  6692.  
  6693.  If <minor> is not specified, it is 0.5*<major>.  The default size is 1.0 for
  6694.  major tics and 0.5 for minor tics.  Note that it is possible to have the tic
  6695.  marks pointing outward by specifying a negative size.
  6696.  
  6697. 
  6698. File: gnuplot.info, Node: timestamp, Prev: ticscale, Up: set-show, Next: timefmt
  6699.  
  6700.  The command `set timestamp` places the time and date of the plot in the left
  6701.  margin.
  6702.  
  6703.  Syntax:
  6704.        set timestamp {"<format>"} {top|bottom} {{no}rotate}
  6705.                      {<xoff>}{,<yoff>} {"<font>"}
  6706.        set notimestamp
  6707.        show timestamp
  6708.  
  6709.  The format string allows you to choose the format used to write the date and
  6710.  time.  Its default value is what asctime() uses: "%a %b %d %H:%M:%S %Y"
  6711.  (weekday, month name, day of the month, hours, minutes, seconds, four-digit
  6712.  year).  With `top` or `bottom` you can place the timestamp at the top or
  6713.  bottom of the left margin (default: bottom).  `rotate` (*note rotate:: ) lets
  6714.  you write the timestamp vertically, if your terminal supports vertical
  6715.  text.  The constants <xoff> and <off> are offsets from the default position
  6716.  given in character screen coordinates.  <font> is used to specify the font
  6717.  with which the time is to be written.
  6718.  
  6719.  The abbreviation `time` may be used in place of `timestamp`.
  6720.  
  6721.  Example:
  6722.        set timestamp "%d/%m/%y %H:%M" 80,-2 "Helvetica"
  6723.  
  6724.  See `set timefmt` (*note timefmt:: ) for more information about time format
  6725.  strings.
  6726.  
  6727.  
  6728. 
  6729. File: gnuplot.info, Node: timefmt, Prev: timestamp, Up: set-show, Next: title
  6730.  
  6731.  This command applies to timeseries where data are composed of dates/times.
  6732.  It has no meaning unless the command `set xdata time` is given also.
  6733.  
  6734.  Syntax:
  6735.        set timefmt "<format string>"
  6736.        show timefmt
  6737.  
  6738.  The string argument tells `gnuplot` (*note gnuplot:: ) how to read timedata
  6739.  from the datafile. The valid formats are:
  6740.  
  6741.        Format       Explanation
  6742.        %d           day of the month, 1--31
  6743.        %m           month of the year, 1--12
  6744.        %y           year, 0--99
  6745.        %Y           year, 4-digit
  6746.        %j           day of the year, 1--365
  6747.        %H           hour, 0--24
  6748.        %M           minute, 0--60
  6749.        %S           second, 0--60
  6750.        %b           three-character abbreviation of the name of the month
  6751.        %B           name of the month
  6752.  Any character is allowed in the string, but must match exactly.  \t (tab) is
  6753.  recognized.  Backslash-octals (\nnn) are converted to char.  If there is no
  6754.  separating character between the time/date elements, then %d, %m, %y, %H, %M
  6755.  and %S read two digits each, %Y reads four digits and %j reads three digits.
  6756.  %b requires three characters, and %B requires as many as it needs.
  6757.  
  6758.  Spaces are treated slightly differently.  A space in the string stands for
  6759.  zero or more whitespace characters in the file.  That is, "%H %M" can be used
  6760.  to read "1220" and "12     20" as well as "12 20".
  6761.  
  6762.  Each set of non-blank characters in the timedata counts as one column in the
  6763.  `using n:n` specification.  Thus `11:11  25/12/76  21.0` consists of three
  6764.  columns.  To avoid confusion, `gnuplot` requires that you provide a complete
  6765.  `using` (*note using:: ) specification if your file contains timedata.
  6766.  
  6767.  Since `gnuplot` cannot read non-numerical text, if the date format includes
  6768.  the day or month in words, the format string must exclude this text.  But
  6769.  it can still be printed with the "%a", "%A", "%b", or "%B" specifier: see
  6770.  `set format` (*note format:: ) for more details about these and other options
  6771.  for printing timedata.  (`gnuplot` will determine the proper month and weekday
  6772.  from the numerical values.)
  6773.  
  6774.  See also `set xdata` (*note xdata:: ) and Time/date for more information.
  6775.  
  6776.  Example:
  6777.        set timefmt "%d/%m/%Y\t%H:%M"
  6778.  tells `gnuplot` to read date and time separated by tab.  (But look closely at
  6779.  your data---what began as a tab may have been converted to spaces somewhere
  6780.  along the line; the format string must match what is actually in the file.)
  6781.  
  6782. 
  6783. File: gnuplot.info, Node: title, Prev: timefmt, Up: set-show, Next: tmargin
  6784.  
  6785.  The `set title` command produces a plot title that is centered at the top of
  6786.  the plot.  `set title` is a special case of `set label` (*note label:: ).
  6787.  
  6788.  Syntax:
  6789.        set title {"<title-text>"} {<xoff>}{,<yoff>} {"<font>,{<size>}"}
  6790.        show title
  6791.  
  6792.  Specifying constants <xoff> or <yoff> as optional offsets for the title will
  6793.  move the title <xoff> or <yoff> character screen coordinates (not graph
  6794.  coordinates).  For example, "`set title ,-1`" will change only the y offset
  6795.  of the title, moving the title down by roughly the height of one character.
  6796.  
  6797.  <font> is used to specify the font with which the title is to be written;
  6798.  the units of the font <size> depend upon which terminal is used.
  6799.  
  6800.  `set title` with no parameters clears the title.
  6801.  
  6802.  See `syntax` (*note Syntax:: ) for details about the processing of backslash
  6803.  sequences and the distinction between single- and double-quotes.
  6804.  
  6805.  
  6806. 
  6807. File: gnuplot.info, Node: tmargin, Prev: title, Up: set-show, Next: trange
  6808.  
  6809.  The command `set tmargin` sets the size of the top margin.  Please see
  6810.  `set margin` (*note margin:: ) for details.
  6811.  
  6812.  
  6813. 
  6814. File: gnuplot.info, Node: trange, Prev: tmargin, Up: set-show, Next: urange
  6815.  
  6816.  The `set trange` command sets the parametric range used to compute x and y
  6817.  values when in parametric or polar modes.  Please see `set xrange`
  6818.  (*note xrange:: ) for details.
  6819.  
  6820.  
  6821. 
  6822. File: gnuplot.info, Node: urange, Prev: trange, Up: set-show, Next: variables
  6823.  
  6824.  The `set urange` and `set vrange` (*note vrange:: ) commands set the
  6825.  parametric ranges used to compute x, y, and z values when in `splot`
  6826.  (*note splot:: ) parametric mode.  Please see `set xrange` (*note xrange:: )
  6827.  for details.
  6828.  
  6829.  
  6830. 
  6831. File: gnuplot.info, Node: variables, Prev: urange, Up: set-show, Next: version
  6832.  
  6833.  The `show variables` command lists all user-defined variables and their
  6834.  values.
  6835.  
  6836.  Syntax:
  6837.        show variables
  6838.  
  6839. 
  6840. File: gnuplot.info, Node: version, Prev: variables, Up: set-show, Next: view
  6841.  
  6842.  The `show version` command lists the version of gnuplot being run, its last
  6843.  modification date, the copyright holders, and email addresses for the FAQ,
  6844.  the info-gnuplot mailing list, and reporting bugs--in short, the information
  6845.  listed on the screen when the program is invoked interactively.
  6846.  
  6847.  Syntax:
  6848.        show version {long}
  6849.  
  6850.  When the `long` option is given, it also lists the operating system, the
  6851.  compilation options used when `gnuplot` (*note gnuplot:: ) was installed, the
  6852.  location of the help file, and (again) the useful email addresses.
  6853.  
  6854.  
  6855. 
  6856. File: gnuplot.info, Node: view, Prev: version, Up: set-show, Next: vrange
  6857.  
  6858.  The `set view` command sets the viewing angle for `splot`s
  6859.  (*note splot:: ).  It controls how the 3-d coordinates of the plot are mapped
  6860.  into the 2-d screen space.  It provides controls for both rotation and scaling
  6861.  of the plotted data, but supports orthographic projections only.
  6862.  
  6863.  Syntax:
  6864.        set view <rot_x> {,{<rot_z>}{,{<scale>}{,<scale_z>}}}
  6865.        show view
  6866.  
  6867.  where <rot_x> and <rot_z> control the rotation angles (in degrees) in a
  6868.  virtual 3-d coordinate system aligned with the screen such that initially
  6869.  (that is, before the rotations are performed) the screen horizontal axis is
  6870.  x, screen vertical axis is y, and the axis perpendicular to the screen is z.
  6871.  The first rotation applied is <rot_x> around the x axis.  The second rotation
  6872.  applied is <rot_z> around the new z axis.
  6873.  
  6874.  <rot_x> is bounded to the [0:180] range with a default of 60 degrees, while
  6875.  <rot_z> is bounded to the [0:360] range with a default of 30 degrees.
  6876.  <scale> controls the scaling of the entire `splot`, while <scale_z> scales
  6877.  the z axis only.  Both scales default to 1.0.
  6878.  
  6879.  Examples:
  6880.        set view 60, 30, 1, 1
  6881.        set view ,,0.5
  6882.  
  6883.  The first sets all the four default values.  The second changes only scale,
  6884.  to 0.5.
  6885.  
  6886.  See also `set ticslevel` (*note ticslevel:: ).
  6887.  
  6888.  
  6889. 
  6890. File: gnuplot.info, Node: vrange, Prev: view, Up: set-show, Next: x2data
  6891.  
  6892.  The `set urange` (*note urange:: ) and set vrange commands set the parametric
  6893.  ranges used to compute x, y, and z values when in `splot` (*note splot:: )
  6894.  parametric mode.  Please see `set xrange` (*note xrange:: ) for details.
  6895.  
  6896.  
  6897. 
  6898. File: gnuplot.info, Node: x2data, Prev: vrange, Up: set-show, Next: x2dtics
  6899.  
  6900.  The `set x2data` command sets data on the x2 (top) axis to timeseries
  6901.  (dates/times).  Please see `set xdata` (*note xdata:: ).
  6902.  
  6903.  
  6904. 
  6905. File: gnuplot.info, Node: x2dtics, Prev: x2data, Up: set-show, Next: x2label
  6906.  
  6907.  The `set x2dtics` command changes tics on the x2 (top) axis to days of the
  6908.  week.  Please see `set xdtics` (*note xdtics:: ) for details.
  6909.  
  6910.  
  6911. 
  6912. File: gnuplot.info, Node: x2label, Prev: x2dtics, Up: set-show, Next: x2mtics
  6913.  
  6914.  The `set x2label` command sets the label for the x2 (top) axis.  Please see
  6915.  `set xlabel` (*note xlabel:: ).
  6916.  
  6917.  
  6918. 
  6919. File: gnuplot.info, Node: x2mtics, Prev: x2label, Up: set-show, Next: x2range
  6920.  
  6921.  The `set x2mtics` command changes tics on the x2 (top) axis to months of the
  6922.  year.  Please see `set xmtics` (*note xmtics:: ) for details.
  6923.  
  6924.  
  6925. 
  6926. File: gnuplot.info, Node: x2range, Prev: x2mtics, Up: set-show, Next: x2tics
  6927.  
  6928.  The `set x2range` command sets the horizontal range that will be displayed on
  6929.  the x2 (top) axis.  Please see `set xrange` (*note xrange:: ) for details.
  6930.  
  6931.  
  6932. 
  6933. File: gnuplot.info, Node: x2tics, Prev: x2range, Up: set-show, Next: x2zeroaxis
  6934.  
  6935.  The `set x2tics` command controls major (labelled) tics on the x2 (top) axis.
  6936.  Please see `set xtics` (*note xtics:: ) for details.
  6937.  
  6938.  
  6939. 
  6940. File: gnuplot.info, Node: x2zeroaxis, Prev: x2tics, Up: set-show, Next: xdata
  6941.  
  6942.  The `set x2zeroaxis` command draws a line at the origin of the x2 (top) axis
  6943.  (y2 = 0).  For details, please see
  6944.  `set zeroaxis` (*note zeroaxis:: ).
  6945.  
  6946.  
  6947. 
  6948. File: gnuplot.info, Node: xdata, Prev: x2zeroaxis, Up: set-show, Next: xdtics
  6949.  
  6950.  This command sets the datatype on the x axis to time/date.  A similar command
  6951.  does the same thing for each of the other axes.
  6952.  
  6953.  Syntax:
  6954.        set xdata {time}
  6955.        show xdata
  6956.  
  6957.  The same syntax applies to `ydata` (*note ydata:: ),  `zdata`
  6958.  (*note zdata:: ),  `x2data` (*note x2data:: ) and  `y2data`
  6959.  (*note y2data:: ).
  6960.  
  6961.  The `time` option signals that the datatype is indeed time/date.  If the
  6962.  option is not specified, the datatype reverts to normal.
  6963.  
  6964.  See `set timefmt` (*note timefmt:: ) to tell  `gnuplot` (*note gnuplot:: ) how
  6965.  to read date or time data.  The time/date is converted to seconds from start
  6966.  of the century.  There is currently only one timefmt, which implies that all
  6967.  the time/date columns must confirm to this format.  Specification of ranges
  6968.  should be supplied as quoted strings according to this format to avoid
  6969.  interpretation of the time/date as an expression.
  6970.  
  6971.  The function 'strftime' (type "man strftime" on unix to look it up) is used
  6972.  to print tic-mark labels.  `gnuplot` tries to figure out a reasonable format
  6973.  for this  unless the `set format x "string"` has supplied something that does
  6974.  not look like a decimal format (more than one '%' or neither %f nor %g).
  6975.  
  6976.  See also `Time/date` for more information.
  6977.  
  6978. 
  6979. File: gnuplot.info, Node: xdtics, Prev: xdata, Up: set-show, Next: xlabel
  6980.  
  6981.  The `set xdtics` commands converts the x-axis tic marks to days of the week
  6982.  where 0=Sun and 6=Sat.  Overflows are converted modulo 7 to dates.  `set
  6983.  noxdtics` returns the labels to their default values.  Similar commands do
  6984.  the same things for the other axes.
  6985.  
  6986.  Syntax:
  6987.        set xdtics
  6988.        set noxdtics
  6989.        show xdtics
  6990.  
  6991.  The same syntax applies to `ydtics` (*note ydtics:: ),  `zdtics`
  6992.  (*note zdtics:: ),  `x2dtics` (*note x2dtics:: ) and  `y2dtics`
  6993.  (*note y2dtics:: ).
  6994.  
  6995.  See also the `set format` (*note format:: ) command.
  6996.  
  6997.  
  6998. 
  6999. File: gnuplot.info, Node: xlabel, Prev: xdtics, Up: set-show, Next: xmtics
  7000.  
  7001.  The `set xlabel` command sets the x axis label.  Similar commands set labels
  7002.  on the other axes.
  7003.  
  7004.  Syntax:
  7005.        set xlabel {"<label>"} {<xoff>}{,<yoff>} {"<font>{,<size>}"}
  7006.        show xlabel
  7007.  
  7008.  The same syntax applies to `x2label` (*note x2label:: ),  `ylabel`
  7009.  (*note ylabel:: ),  `y2label` (*note y2label:: ) and  `zlabel`
  7010.  (*note zlabel:: ).
  7011.  
  7012.  Specifying the constants <xoff> or <yoff> as optional offsets for a label
  7013.  will move it <xoff> or <yoff> character widths or heights.  For example,
  7014.  "` set xlabel -1`" will change only the x offset of the xlabel, moving the
  7015.  label roughly one character width to the left.   The size of a character
  7016.  depends on both the font and the terminal.
  7017.  
  7018.  <font> is used to specify the font in which the label is written; the units
  7019.  of the font <size> depend upon which terminal is used.
  7020.  
  7021.  To clear a label, put no options on the command line, e.g., "`set y2label`".
  7022.  
  7023.  The default positions of the axis labels are as follows:
  7024.  
  7025.  xlabel:  The x-axis label is centered below the bottom axis.
  7026.  
  7027.  ylabel:  The position of the y-axis label depends on the terminal, and can be
  7028.  one of the following three positions:
  7029.  
  7030.  1. Horizontal text flushed left at the top left of the plot.  Terminals that
  7031.  cannot rotate text will probably use this method.  If `set x2tics`
  7032.  (*note x2tics:: ) is also in use, the ylabel may overwrite the left-most x2tic
  7033.  label.  This may be remedied by adjusting the ylabel position or the left
  7034.  margin.
  7035.  
  7036.  2. Vertical text centered vertically at the left of the plot.  Terminals
  7037.  that can rotate text will probably use this method.
  7038.  
  7039.  3. Horizontal text centered vertically at the left of the plot.  The EEPIC,
  7040.  LaTeX and TPIC drivers use this method.  The user must insert line breaks
  7041.  using \\ to prevent the ylabel from overwriting the plot.  To produce a
  7042.  vertical row of characters, add \\ between every printing character (but this
  7043.  is ugly).
  7044.  
  7045.  zlabel: The z-axis label is centered along the z axis and placed in the space
  7046.  above the grid level.
  7047.  
  7048.  y2label: The y2-axis label is placed to the right of the y2 axis.  The
  7049.  position is terminal-dependent in the same manner as is the y-axis label.
  7050.  
  7051.  x2label: The x2-axis label is placed above the top axis but below the plot
  7052.  title.  It is also possible to create an x2-axis label by using new-line
  7053.  characters to make a multi-line plot title, e.g.,
  7054.  
  7055.        set title "This is the title\n\nThis is the x2label"
  7056.  
  7057.  Note that double quotes must be used.  The same font will be used for both
  7058.  lines, of course.
  7059.  
  7060.  If you are not satisfied with the default position of an axis label, use `set
  7061.  label` instead--that command gives you much more control over where text is
  7062.  placed.
  7063.  
  7064.  Please see `set syntax` for further information about backslash processing
  7065.  and the difference between single- and double-quoted strings.
  7066.  
  7067. 
  7068. File: gnuplot.info, Node: xmtics, Prev: xlabel, Up: set-show, Next: xrange
  7069.  
  7070.  The `set xmtics` commands converts the x-axis tic marks to months of the
  7071.  year where 1=Jan and 12=Dec.  Overflows are converted modulo 12 to months.
  7072.  The tics are returned to their default labels by `set noxmtics`.  Similar
  7073.  commands perform the same duties for the other axes.
  7074.  
  7075.  Syntax:
  7076.        set xmtics
  7077.        set noxmtics
  7078.        show xmtics
  7079.  
  7080.  The same syntax applies to `x2mtics` (*note x2mtics:: ),  `ymtics`
  7081.  (*note ymtics:: ),  `y2mtics` (*note y2mtics:: ), and  `zmtics`
  7082.  (*note zmtics:: ).
  7083.  
  7084.  See also the `set format` (*note format:: ) command.
  7085.  
  7086.  
  7087. 
  7088. File: gnuplot.info, Node: xrange, Prev: xmtics, Up: set-show, Next: xtics
  7089.  
  7090.  The `set xrange` command sets the horizontal range that will be displayed.
  7091.  A similar command exists for each of the other axes, as well as for the
  7092.  polar radius r and the parametric variables t, u, and v.
  7093.  
  7094.  Syntax:
  7095.        set xrange [{{<min>}:{<max>}}] {{no}reverse} {{no}writeback}
  7096.        show xrange
  7097.  
  7098.  where <min> and <max> terms are constants, expressions or an asterisk to set
  7099.  autoscaling.  If the data are time/date, you must give the range as a quoted
  7100.  string according to the `set timefmt` (*note timefmt:: ) format.  Any value
  7101.  omitted will not be changed.
  7102.  
  7103.  The same syntax applies to `yrange` (*note yrange:: ),  `zrange`
  7104.  (*note zrange:: ),  `x2range` (*note x2range:: ),  `y2range`
  7105.  (*note y2range:: ), `rrange` (*note rrange:: ),  `trange` (*note trange:: ),
  7106.   `urange` (*note urange:: ) and  `vrange` (*note vrange:: ).
  7107.  
  7108.  The `reverse` option reverses the direction of the axis, e.g., `set xrange
  7109.  [0:1] reverse` will produce an axis with 1 on the left and 0 on the right.
  7110.  This is identical to the axis produced by `set xrange [1:0]`, of course.
  7111.  `reverse` is intended primarily for use with `autoscale`
  7112.  (*note autoscale:: ).
  7113.  
  7114.  The `writeback` option essentially saves the range found by `autoscale` in
  7115.  the buffers that would be filled by `set xrange`.  This is useful if you wish
  7116.  to plot several functions together but have the range determined by only
  7117.  some of them.  The `writeback` operation is performed during the `plot`
  7118.  (*note plot:: ) execution, so it must be specified before that command.  For
  7119.  example,
  7120.  
  7121.        set xrange [-10:10]
  7122.        set yrange [] writeback
  7123.        plot sin(x)
  7124.        set noautoscale y
  7125.        replot x/2
  7126.  
  7127.  results in a yrange of [-1:1] as found only from the range of sin(x); the
  7128.  [-5:5] range of x/2 is ignored.  Executing `show yrange` after each command
  7129.  in the above example should help you understand what is going on.
  7130.  
  7131.  In 2-d, `xrange` and `yrange` determine the extent of the axes, `trange`
  7132.  determines the range of the parametric variable in parametric mode or the
  7133.  range of the angle in polar mode.  Similarly in parametric 3-d, `xrange`,
  7134.  `yrange`, and `zrange` govern the axes and `urange` and `vrange` govern the
  7135.  parametric variables.
  7136.  
  7137.  In polar mode, `rrange` determines the radial range plotted.  <rmin> acts as
  7138.  an additive constant to the radius, whereas <rmax> acts as a clip to the
  7139.  radius---no point with radius greater than <rmax> will be plotted.  `xrange`
  7140.  and `yrange` are affected---the ranges can be set as if the graph was of
  7141.  r(t)-rmin, with rmin added to all the labels.
  7142.  
  7143.  Any range may be partially or totally autoscaled, although it may not make
  7144.  sense to autoscale a parametric variable unless it is plotted with data.
  7145.  
  7146.  Ranges may also be specified on the `plot` command line.  A range given on
  7147.  the plot line will be used for that single `plot` command; a range given by
  7148.  a `set` (*note set-show:: ) command will be used for all subsequent plots that
  7149.  do not specify their own ranges.  The same holds true for `splot`
  7150.  (*note splot:: ).
  7151.  
  7152.  Examples:
  7153.  
  7154.  To set the xrange to the default:
  7155.        set xrange [-10:10]
  7156.  
  7157.  To set the yrange to increase downwards:
  7158.        set yrange [10:-10]
  7159.  
  7160.  To change zmax to 10 without affecting zmin (which may still be autoscaled):
  7161.        set zrange [:10]
  7162.  
  7163.  To autoscale xmin while leaving xmax unchanged:
  7164.        set xrange [*:]
  7165.  
  7166. 
  7167. File: gnuplot.info, Node: xtics, Prev: xrange, Up: set-show, Next: xzeroaxis
  7168.  
  7169.  Fine control of the major (labelled) tics on the x axis is possible with the
  7170.  `set xtics` command.  The tics may be turned off with the `set noxtics`
  7171.  command, and may be turned on (the default state) with `set xtics`.  Similar
  7172.  commands control the major tics on the y, z, x2 and y2 axes.
  7173.  
  7174.  Syntax:
  7175.        set xtics {axis | border} {{no}mirror} {{no}rotate}
  7176.                  {  autofreq
  7177.                   | <incr>
  7178.                   | <start>, <incr> {,<end>}
  7179.                   | ({"<label>"} <pos> {,{"<label>"} <pos>}...) }
  7180.        set noxtics
  7181.        show xtics
  7182.  
  7183.  The same syntax applies to `ytics` (*note ytics:: ),  `ztics`
  7184.  (*note ztics:: ),  `x2tics` (*note x2tics:: ) and  `y2tics`
  7185.  (*note y2tics:: ).
  7186.  
  7187.  `axis` or `border` (*note border:: ) tells  `gnuplot` (*note gnuplot:: ) to
  7188.  put the tics (both the tics themselves and the accompanying labels) along the
  7189.  axis or the border, respectively.  If the axis is very close to the border,
  7190.  the `axis` option can result in tic labels overwriting other text written in
  7191.  the margin.
  7192.  
  7193.  `mirror` tells `gnuplot` to put unlabelled tics at the same positions on the
  7194.  opposite border.  `nomirror` does what you think it does.
  7195.  
  7196.  `rotate` (*note rotate:: ) asks gnuplot to rotate the text through 90 degrees,
  7197.  which will be done if the terminal driver in use supports text
  7198.  rotation.  `norotate` cancels this.
  7199.  
  7200.  The defaults are `border mirror norotate` for tics on the x and y axes, and
  7201.  `border nomirror norotate` for tics on the x2 and y2 axes.  For the z axis,
  7202.  the the `{axis | border}` option is not available and the default is
  7203.  `nomirror`.  If you do want to mirror the z-axis tics, you might want to
  7204.  create a bit more room for them with `set border`.
  7205.  
  7206.  `set xtics` with no options restores the default border or axis if xtics are
  7207.  being displayed;  otherwise it has no effect.  Any previously specified tic
  7208.  frequency or position {and labels} are retained.
  7209.  
  7210.  Positions of the tics are calculated automatically by default or if the
  7211.  `autofreq` option is given; otherwise they may be specified in either of
  7212.  two forms:
  7213.  
  7214.  The implicit <start>, <incr>, <end> form specifies that a series of tics will
  7215.  be plotted on the axis between the values <start> and <end> with an increment
  7216.  of <incr>.  If <end> is not given, it is assumed to be infinity.  The
  7217.  increment may be negative.  If neither <start> nor <end> is given, <start> is
  7218.  assumed to be negative infinity, <end> is assumed to be positive infinity,
  7219.  and the tics will be drawn at integral multiples of <step>.  If the axis is
  7220.  logarithmic, the increment will be used as a multiplicative factor.
  7221.  
  7222.  Examples:
  7223.  
  7224.  Make tics at 0, 0.5, 1, 1.5, ..., 9.5, 10.
  7225.        set xtics 0,.5,10
  7226.  
  7227.  Make tics at ..., -10, -5, 0, 5, 10, ...
  7228.        set xtics 5
  7229.  
  7230.  Make tics at 1, 100, 1e4, 1e6, 1e8.
  7231.        set logscale x; set xtics 1,100,10e8
  7232.  
  7233.  The explicit ("<label>" <pos>, ...) form allows arbitrary tic positions or
  7234.  non-numeric tic labels.  A set of tics is a set of positions, each with its
  7235.  own optional label.  Note that the label is a string enclosed by quotes.  It
  7236.  may be a constant string, such as "hello", may contain formatting information
  7237.  for converting the position into its label, such as "%3f clients", or may be
  7238.  empty, "".  See `set format` (*note format:: ) for more information.  If no
  7239.  string is given, the default label (numerical) is used.  In this form, the
  7240.  tics do not need to be listed in numerical order.
  7241.  
  7242.  Examples:
  7243.        set xtics ("low" 0, "medium" 50, "high" 100)
  7244.        set xtics (1,2,4,8,16,32,64,128,256,512,1024)
  7245.        set ytics ("bottom" 0, "" 10, "top" 20)
  7246.  
  7247.  In the second example, all tics are labelled.  In the third, only the end
  7248.  tics are labelled.
  7249.  
  7250.  However they are specified, tics will only be plotted when in range.
  7251.  
  7252.  Format (or omission) of the tic labels is controlled by `set format`, unless
  7253.  the explicit text of a labels is included in the `set xtic (`<label>`)` form.
  7254.  
  7255.  Minor (unlabelled) tics can be added by the `set mxtics` (*note mxtics:: )
  7256.  command.
  7257.  
  7258.  In case of timeseries data, position values must be given as quoted dates
  7259.  or times according to the format `timefmt` (*note timefmt:: ).  If the
  7260.  <start>, <incr>, <end> form is used, <start> and <end> must be given according
  7261.  to `timefmt`, but <incr> must be in seconds.  Times will be written out
  7262.  according to the format given on `set format`, however.
  7263.  
  7264.  Examples:
  7265.        set xdata time
  7266.        set timefmt "%d/%m"
  7267.        set format x "%b %d"
  7268.        set xrange ["01/12":"06/12"]
  7269.        set xtics "01/12", 172800, "05/12"
  7270.  
  7271.        set xdata time
  7272.        set timefmt "%d/%m"
  7273.        set format x "%b %d"
  7274.        set xrange ["01/12":"06/12"]
  7275.        set xtics ("01/12", "" "03/12", "05/12")
  7276.  Both of these will produce tics "Dec 1", "Dec 3", and "Dec 5", but in the
  7277.  second example the tic at "Dec 3" will be unlabelled.
  7278.  
  7279.  
  7280. 
  7281. File: gnuplot.info, Node: xzeroaxis, Prev: xtics, Up: set-show, Next: y2data
  7282.  
  7283.  The `set xzeroaxis` command draws a line at y = 0.  For details, please see
  7284.  `set zeroaxis` (*note zeroaxis:: ).
  7285.  
  7286.  
  7287. 
  7288. File: gnuplot.info, Node: y2data, Prev: xzeroaxis, Up: set-show, Next: y2dtics
  7289.  
  7290.  The `set y2data` command sets y2 (right-hand) axis data to timeseries
  7291.  (dates/times).  Please see `set xdata` (*note xdata:: ).
  7292.  
  7293.  
  7294. 
  7295. File: gnuplot.info, Node: y2dtics, Prev: y2data, Up: set-show, Next: y2label
  7296.  
  7297.  The `set y2dtics` command changes tics on the y2 (right-hand) axis to days of
  7298.  the week.  Please see `set xdtics` (*note xdtics:: ) for details.
  7299.  
  7300.  
  7301. 
  7302. File: gnuplot.info, Node: y2label, Prev: y2dtics, Up: set-show, Next: y2mtics
  7303.  
  7304.  The `set y2dtics` (*note y2dtics:: ) command sets the label for the y2
  7305.  (right-hand) axis. Please see `set xlabel` (*note xlabel:: ).
  7306.  
  7307.  
  7308. 
  7309. File: gnuplot.info, Node: y2mtics, Prev: y2label, Up: set-show, Next: y2range
  7310.  
  7311.  The `set y2mtics` command changes tics on the y2 (right-hand) axis to months
  7312.  of the year.  Please see `set xmtics` (*note xmtics:: ) for details.
  7313.  
  7314.  
  7315. 
  7316. File: gnuplot.info, Node: y2range, Prev: y2mtics, Up: set-show, Next: y2tics
  7317.  
  7318.  The `set y2range` command sets the vertical range that will be displayed on
  7319.  the y2 (right-hand) axis.  Please see `set xrange` (*note xrange:: ) for
  7320.  details.
  7321.  
  7322.  
  7323. 
  7324. File: gnuplot.info, Node: y2tics, Prev: y2range, Up: set-show, Next: y2zeroaxis
  7325.  
  7326.  The `set y2tics` command controls major (labelled) tics on the y2 (right-hand)
  7327.  axis.  Please see `set xtics` (*note xtics:: ) for details.
  7328.  
  7329.  
  7330. 
  7331. File: gnuplot.info, Node: y2zeroaxis, Prev: y2tics, Up: set-show, Next: ydata
  7332.  
  7333.  The `set y2zeroaxis` command draws a line at the origin of the y2 (right-hand)
  7334.  axis (x2 = 0).  For details, please see `set zeroaxis` (*note zeroaxis:: ).
  7335.  
  7336.  
  7337. 
  7338. File: gnuplot.info, Node: ydata, Prev: y2zeroaxis, Up: set-show, Next: ydtics
  7339.  
  7340.  Sets y-axis data to timeseries (dates/times).  Please see `set xdata`
  7341.  (*note xdata:: ).
  7342.  
  7343.  
  7344. 
  7345. File: gnuplot.info, Node: ydtics, Prev: ydata, Up: set-show, Next: ylabel
  7346.  
  7347.  The `set ydtics` command changes tics on the y axis to days of the week.
  7348.  Please see `set xdtics` (*note xdtics:: ) for details.
  7349.  
  7350.  
  7351. 
  7352. File: gnuplot.info, Node: ylabel, Prev: ydtics, Up: set-show, Next: ymtics
  7353.  
  7354.  This command sets the label for the y axis.  Please see `set xlabel`
  7355.  (*note xlabel:: ).
  7356.  
  7357.  
  7358. 
  7359. File: gnuplot.info, Node: ymtics, Prev: ylabel, Up: set-show, Next: yrange
  7360.  
  7361.  The `set ymtics` command changes tics on the y axis to months of the year.
  7362.  Please see `set xmtics` (*note xmtics:: ) for details.
  7363.  
  7364.  
  7365. 
  7366. File: gnuplot.info, Node: yrange, Prev: ymtics, Up: set-show, Next: ytics
  7367.  
  7368.  The `set yrange` command sets the vertical range that will be displayed on
  7369.  the y axis.  Please see `set xrange` (*note xrange:: ) for details.
  7370.  
  7371.  
  7372. 
  7373. File: gnuplot.info, Node: ytics, Prev: yrange, Up: set-show, Next: yzeroaxis
  7374.  
  7375.  The `set ytics` command controls major (labelled) tics on the y axis.
  7376.  Please see `set xtics` (*note xtics:: ) for details.
  7377.  
  7378.  
  7379. 
  7380. File: gnuplot.info, Node: yzeroaxis, Prev: ytics, Up: set-show, Next: zdata
  7381.  
  7382.  The `set yzeroaxis` command draws a line at x = 0.  For details, please see
  7383.  `set zeroaxis` (*note zeroaxis:: ).
  7384.  
  7385.  
  7386. 
  7387. File: gnuplot.info, Node: zdata, Prev: yzeroaxis, Up: set-show, Next: zdtics
  7388.  
  7389.  Set zaxis date to timeseries (dates/times).  Please see `set xdata`
  7390.  (*note xdata:: ).
  7391.  
  7392.  
  7393. 
  7394. File: gnuplot.info, Node: zdtics, Prev: zdata, Up: set-show, Next: zero
  7395.  
  7396.  The `set zdtics` command changes tics on the z axis to days of the week.
  7397.  Please see `set xdtics` (*note xdtics:: ) for details.
  7398.  
  7399.  
  7400. 
  7401. File: gnuplot.info, Node: zero, Prev: zdtics, Up: set-show, Next: zeroaxis
  7402.  
  7403.  The `zero` value is the default threshold for values approaching 0.0.
  7404.  
  7405.  Syntax:
  7406.        set zero <expression>
  7407.        show zero
  7408.  
  7409.  `gnuplot` (*note gnuplot:: ) will not plot a point if its imaginary part is
  7410.  greater in magnitude than the `zero` threshold.  This threshold is also used
  7411.  in various other parts of `gnuplot` as a (crude) numerical-error
  7412.  threshold.  The default `zero` value is 1e-8.  `zero` values larger than 1e-3
  7413.  (the reciprocal of the number of pixels in a typical bitmap display) should
  7414.  probably be avoided, but it is not unreasonable to set `zero` to 0.0.
  7415.  
  7416.  
  7417. 
  7418. File: gnuplot.info, Node: zeroaxis, Prev: zero, Up: set-show, Next: zlabel
  7419.  
  7420.  The x axis may be drawn by `set xzeroaxis` (*note xzeroaxis:: ) and removed by
  7421.  set noxzeroaxis. Similar commands behave similarly for the y, x2, and y2
  7422.  axes.
  7423.  
  7424.  Syntax:
  7425.        set {x|x2|y|y2|}zeroaxis { {linestyle | ls <line_style>}
  7426.                                   | { linetype | lt <line_type>}
  7427.                                     { linewidth | lw <line_width>}}
  7428.        set no{x|x2|y|y2|}zeroaxis
  7429.        show {x|y|}zeroaxis
  7430.  
  7431.  
  7432.  By default, these options are off.  The selected zero axis is drawn
  7433.  with a line of type <line_type> and width <line_width> (if supported
  7434.  by the terminal driver currently in use), or a user-defined style
  7435.  <line_style>.
  7436.  
  7437.  If no linetype is specified, any zero axes selected will be drawn
  7438.  using the axis linetype (linetype 0).
  7439.  
  7440.  `set zeroaxis l` is equivalent to `set xzeroaxis l; set yzeroaxis l`. `set
  7441.  nozeroaxis` is equivalent to `set noxzeroaxis; set noyzeroaxis`.
  7442.  
  7443. 
  7444. File: gnuplot.info, Node: zlabel, Prev: zeroaxis, Up: set-show, Next: zmtics
  7445.  
  7446.  This command sets the label for the z axis.  Please see `set xlabel`
  7447.  (*note xlabel:: ).
  7448.  
  7449.  
  7450. 
  7451. File: gnuplot.info, Node: zmtics, Prev: zlabel, Up: set-show, Next: zrange
  7452.  
  7453.  The `set zmtics` command changes tics on the z axis to months of the year.
  7454.  Please see `set xmtics` (*note xmtics:: ) for details.
  7455.  
  7456.  
  7457. 
  7458. File: gnuplot.info, Node: zrange, Prev: zmtics, Up: set-show, Next: ztics
  7459.  
  7460.  The `set zrange` command sets the range that will be displayed on the z axis.
  7461.  The zrange is used only by `splot` (*note splot:: ) and is ignored by  `plot`
  7462.  (*note plot:: ).  Please see set xrange` for details.
  7463.  
  7464.  
  7465. 
  7466. File: gnuplot.info, Node: ztics, Prev: zrange, Up: set-show
  7467.  
  7468.  The `set ztics` command controls major (labelled) tics on the z axis.
  7469.  Please see `set xtics` (*note xtics:: ) for details.
  7470.  
  7471.  
  7472. 
  7473. File: gnuplot.info, Node: shell, Prev: set-show, Up: Commands, Next: splot
  7474.  
  7475.  The `shell` command spawns an interactive shell.  To return to `gnuplot`
  7476.  (*note gnuplot:: ), type `logout` if using VMS, `exit` (*note exit:: ) or the
  7477.  END-OF-FILE character if using Unix, `endcli` if using AmigaOS, or `exit` if
  7478.  using MS-DOS or OS/2.
  7479.  
  7480.  A single shell command may be spawned by preceding it with the ! character
  7481.  ($ if using VMS) at the beginning of a command line.  Control will return
  7482.  immediately to `gnuplot` after this command is executed.  For example, in
  7483.  Unix, AmigaOS, MS-DOS or OS/2,
  7484.  
  7485.        ! dir
  7486.  
  7487.  prints a directory listing and then returns to `gnuplot`.
  7488.  
  7489.  On an Atari, the `!` command first checks whether a shell is already loaded
  7490.  and uses it, if available.  This is practical if `gnuplot` is run from
  7491.  `gulam`, for example.
  7492.  
  7493. 
  7494. File: gnuplot.info, Node: splot, Prev: shell, Up: Commands, Next: data-file
  7495.  
  7496.  `splot` is the command for drawing 3-d plots (well, actually projections on
  7497.  a 2-d surface, but you knew that).  It can create a plot from functions or
  7498.  a data file in a manner very similar to the `plot` (*note plot:: ) command.
  7499.  
  7500.  See `plot` for features common to the `plot` command; only differences are
  7501.  discussed in detail here.  Note specifically that the `binary`
  7502.  (*note binary:: ) and  `matrix` (*note matrix:: ) options (discussed under
  7503.  "datafile-modifiers") are not available for `plot`.
  7504.  
  7505.  Syntax:
  7506.        splot {<ranges>}
  7507.              <function> | "<datafile>" {datafile-modifiers}}
  7508.              {<title-spec>} {with <style>}
  7509.              {, {definitions,} <function> ...}
  7510.  
  7511.  where either a <function> or the name of a data file enclosed in quotes is
  7512.  supplied.  The function can be a mathematical expression, or a triple of
  7513.  mathematical expressions in parametric mode.
  7514.  
  7515.  By default `splot` draws the xy plane completely below the plotted data.
  7516.  The offset between the lowest ztic and the xy plane can be changed by `set
  7517.  ticslevel`.  The orientation of a `splot` projection is controlled by
  7518.  `set view` (*note view:: ).  See set view and nd `set ticslevel`
  7519.  (*note ticslevel:: ) for more information.
  7520.  
  7521.  The syntax for setting ranges on the `splot` command is the same as for
  7522.  `plot`.  In non-parametric mode, the order in which ranges must be given is
  7523.  `xrange` (*note xrange:: ),  `yrange` (*note yrange:: ), and  `zrange`
  7524.  (*note zrange:: ).  In parametric mode, the order is  `urange`
  7525.  (*note urange:: ), `vrange` (*note vrange:: ), xrange, yrange, and zrange.
  7526.  
  7527.  The `title` (*note title:: ) option is the same as in plot.  The operation of
  7528.  of `with` (*note with:: ) is also the same as in `plot`, except that the
  7529.  plotting styles available to `splot` are limited to `lines` (*note lines:: ),
  7530.   `points` (*note points:: ),  `linespoints` (*note linespoints:: ),  `dots`
  7531.  (*note dots:: ), and  `impulses` (*note impulses:: );  the error-bar
  7532.  capabilities of `plot` are not available for `splot`.
  7533.  
  7534.  The datafile options have more differences.
  7535.  
  7536. * Menu:
  7537.  
  7538. * data-file::
  7539. * grid_data::
  7540. * splot_overview::
  7541.  
  7542. 
  7543. File: gnuplot.info, Node: data-file, Prev: splot, Up: splot, Next: binary
  7544.  
  7545.  As for `plot` (*note plot:: ), discrete data contained in a file can be
  7546.  displayed by specifying the name of the data file, enclosed in quotes,  on the
  7547.  `splot` (*note splot:: ) command line.
  7548.  
  7549.  Syntax:
  7550.        splot '<file_name>' {binary | matrix}
  7551.                            {index <index list>}
  7552.                            {every <every list>}
  7553.                            {using <using list>}
  7554.  
  7555.  The special filenames `""` and `"-"` are permitted, as in `plot`.
  7556.  
  7557.  In brief, `binary` (*note binary:: ) and  `matrix` (*note matrix:: ) indicate
  7558.  that the the data are in a special form, `index` (*note index:: ) selects
  7559.  which data sets in a multi-data-set file are to be plotted, `every`
  7560.  (*note every:: ) specifies which datalines (subsets) within a single data set
  7561.  are to be plotted, and `using` (*note using:: ) determines how the columns
  7562.  within a single record are to be interpreted.
  7563.  
  7564.  The options `index` and `every` behave the same way as with `plot`;  `using`
  7565.  does so also, except that the `using` list must provide three entries
  7566.  instead of two.
  7567.  
  7568.  The `plot` options `thru` (*note thru:: ) and  `smooth` (*note smooth:: ) are
  7569.  not available for splot, but `cntrparams` and `dgrid3d` (*note dgrid3d:: )
  7570.  provide limited smoothing cabilities.
  7571.  
  7572.  Data file organization is essentially the same as for `plot`, except that
  7573.  each point is an (x,y,z) triple.  If only a single value is provided, it
  7574.  will be used for z, the datablock number will be used for y, and the index
  7575.  of the data point in the datablock will be used for x.  If two values are
  7576.  provided, `gnuplot` (*note gnuplot:: ) gives you an error message.  Three
  7577.  values are interpreted as an (x,y,z) triple.  Additional values are generally
  7578.  used as errors, which can be used by `fit` (*note fit:: ).
  7579.  
  7580.  Single blank records separate datablocks in a `splot` datafile; `splot`
  7581.  treats datablocks as the equivalent of function y-isolines.  No line will
  7582.  join points separated by a blank record.  If all datablocks contain the same
  7583.  number of points, `gnuplot` will draw cross-isolines between datablocks,
  7584.  connecting corresponding points.  This is termed "grid data", and is required
  7585.  for drawing a surface, for contouring (`set contour` (*note contour:: )) and
  7586.  hidden-line removal (`set hidden3d` (*note hidden3d:: )). See also splot grid
  7587.  data
  7588.  
  7589.  It is no longer necessary to specify `parametric` (*note parametric:: ) mode
  7590.  for three-column `splot`s.
  7591.  
  7592.  
  7593. * Menu:
  7594.  
  7595. * binary::
  7596. * example datafile::
  7597. * matrix::
  7598.  
  7599. 
  7600. File: gnuplot.info, Node: binary, Prev: data-file, Up: data-file, Next: example datafile
  7601.  
  7602.  `splot` (*note splot:: ) can read binary files written with a specific format
  7603.  (and on a system with a compatible binary file representation.)
  7604.  
  7605.  In previous versions, `gnuplot` (*note gnuplot:: ) dynamically detected binary
  7606.  data files.  It is now necessary to specify the keyword `binary` directly
  7607.  after the filename.
  7608.  
  7609.  Single precision floats are stored in a binary file as follows:
  7610.  
  7611.        <N+1>  <y0>   <y1>   <y2>  ...  <yN>
  7612.         <x0> <z0,0> <z0,1> <z0,2> ... <z0,N>
  7613.         <x1> <z1,0> <z1,1> <z1,2> ... <z1,N>
  7614.          :      :      :      :   ...    :
  7615.  
  7616.  which are converted into triplets:
  7617.        <x0> <y0> <z0,0>
  7618.        <x0> <y1> <z0,1>
  7619.        <x0> <y2> <z0,2>
  7620.         :    :     :
  7621.        <x0> <yN> <z0,N>
  7622.  
  7623.        <x1> <y0> <z1,0>
  7624.        <x1> <y1> <z1,1>
  7625.         :    :     :
  7626.  
  7627.  These triplets are then converted into `gnuplot` iso-curves and then
  7628.  `gnuplot` proceeds in the usual manner to do the rest of the plotting.
  7629.  
  7630.  A collection of matrix and vector manipulation routines (in C) is provided
  7631.  in `binary.c`.  The routine to write binary data is
  7632.  
  7633.        int fwrite_matrix(file,m,nrl,nrl,ncl,nch,row_title,column_title)
  7634.  
  7635.  An example of using these routines is provided in the file `bf_test.c`, which
  7636.  generates binary files for the demo file `demo/binary.dem`.
  7637.  
  7638.  The `index` (*note index:: ) keyword is not supported, since the file format
  7639.  allows only one surface per file.  The `every` (*note every:: ) and  `using`
  7640.  (*note using:: ) filters are supported.  using operates as if the data were
  7641.  read in the above triplet form.
  7642.  
  7643.  
  7644. 
  7645. File: gnuplot.info, Node: example datafile, Prev: binary, Up: data-file, Next: matrix
  7646.  
  7647.  A simple example of plotting a 3-d data file is
  7648.  
  7649.        splot 'datafile.dat'
  7650.  
  7651.  where the file "datafile.dat" might contain:
  7652.  
  7653.        # The valley of the Gnu.
  7654.           0 0 10
  7655.           0 1 10
  7656.           0 2 10
  7657.  
  7658.           1 0 10
  7659.           1 1 5
  7660.           1 2 10
  7661.  
  7662.           2 0 10
  7663.           2 1 1
  7664.           2 2 10
  7665.  
  7666.           3 0 10
  7667.           3 1 0
  7668.           3 2 10
  7669.  
  7670.  Note that "datafile.dat" defines a 4 by 3 grid ( 4 rows of 3 points each ).
  7671.  Rows (datablocks) are separated by blank records.
  7672.  
  7673.  Note also that the x value is held constant within each dataline.  If you
  7674.  instead keep y constant, and plot with hidden-line removal enabled, you will
  7675.  find that the surface is drawn 'inside-out'.
  7676.  
  7677.  Actually for grid data it is not necessary to keep the x values constant
  7678.  within a datablock, nor is it necessary to keep the same sequence of y
  7679.  values.  `gnuplot` (*note gnuplot:: ) requires only that the number of points
  7680.  be the same for each datablock.  However since the surface mesh, from which
  7681.  contours are derived, connects sequentially corresponding points, the effect
  7682.  of an irregular grid on a surface plot is unpredictable and should be
  7683.  examined on a case-by-case basis.
  7684.  
  7685.  
  7686. 
  7687. File: gnuplot.info, Node: matrix, Prev: example datafile, Up: data-file
  7688.  
  7689.  The `matrix` flag indicates that the ASCII data are stored in matrix format.
  7690.  The z-values are read in a row at a time, i. e.,
  7691.        z11 z12 z13 z14 ...
  7692.        z21 z22 z23 z24 ...
  7693.        z31 z32 z33 z34 ...
  7694.  and so forth.  The row and column indices are used for the x- and y-values.
  7695.  
  7696. 
  7697. File: gnuplot.info, Node: grid_data, Prev: data-file, Up: splot, Next: splot_overview
  7698.  
  7699.  The 3D routines are designed for points in a grid format, with one sample,
  7700.  datapoint, at each mesh intersection; the datapoints may originate from
  7701.  either evaluating a function, see `set isosamples` (*note isosamples:: ), or
  7702.  reading a datafile, see `splot datafile` (*note data-file:: ).  The term
  7703.  "isoline" is applied to the mesh lines for both functions and data.  Note that
  7704.  the mesh need not be rectangular in x and y, as it may be parameterized in u
  7705.  and v, see `set isosamples`.
  7706.  
  7707.  However, `gnuplot` (*note gnuplot:: ) does not require that format.  In the
  7708.  case of functions, 'samples' need not be equal to 'isosamples', i.e., not
  7709.  every x-isoline sample need intersect a y-isoline. In the case of data files,
  7710.  if there are an equal number of scattered data points in each datablock, then
  7711.  "isolines" will connect the points in a datablock, and "cross-isolines" will
  7712.  connect the corresponding points in each datablock to generate a
  7713.  "surface".  In either case, contour and hidden3d modes may give different
  7714.  plots than if the points were in the intended format.  Scattered data can be
  7715.  converted to a {different} grid format with `set dgrid3d` (*note dgrid3d:: ).
  7716.  
  7717.  The contour code tests for z intensity along a line between a point on a
  7718.  y-isoline and the corresponding point in the next y-isoline.  Thus a `splot`
  7719.  (*note splot:: ) contour of a surface with samples on the x-isolines that do
  7720.  not coincide with a y-isoline intersection will ignore such samples. Try:
  7721.         set xrange [-pi/2:pi/2]; set yrange [-pi/2:pi/2]        set function
  7722.  style lp        set contour        set isosamples 10,10; set samples 10,10;
  7723.         splot cos(x)*cos(y)        set samples 4,10; replot        set samples
  7724.  10,4; replot
  7725.  
  7726.  
  7727. 
  7728. File: gnuplot.info, Node: splot_overview, Prev: grid_data, Up: splot
  7729.  
  7730.  `splot` (*note splot:: ) can display a surface as a collection of points, or
  7731.  by connecting those points.  As with `plot` (*note plot:: ), the points may be
  7732.  read from a data file or result from evaluation of a function at specified
  7733.  intervals, see `set isosamples`.  The surface may be approximated by
  7734.  connecting the points with straight line segments, see `set surface`
  7735.  (*note surface:: ), in which case the surface can be made opaque with `set
  7736.  hidden3d.`  The orientation from which the 3d surface is viewed can be changed
  7737.  with `set view` (*note view:: ).
  7738.  
  7739.  Additionally, for points in a grid format, `splot` can interpolate points
  7740.  having a common amplitude (see `set contour` (*note contour:: )) and can then
  7741.  connect those new points to display contour lines, either directly with
  7742.  straight-line segments or smoothed lines (see `set cntrparams`).  Functions
  7743.  are already evaluated in a grid format, determined by `set isosamples`
  7744.  (*note isosamples:: ) and  `set samples` (*note samples:: ), while file data
  7745.  must either be in a grid format, as described in `data-file`
  7746.  (*note data-file:: ), or be used to generate a grid (see `set dgrid3d`
  7747.  (*note dgrid3d:: )).
  7748.  
  7749.  Contour lines may be displayed either on the surface or projected onto the
  7750.  base.  The base projections of the contour lines may be written to a
  7751.  file, and then read with `plot`, to take advantage of `plot`'s additional
  7752.  formatting capabilities.
  7753.  
  7754. 
  7755. File: gnuplot.info, Node: test, Prev: splot, Up: Commands, Next: update
  7756.  
  7757.  `test` creates a display of line and point styles and other useful things
  7758.  appropriate for the terminal you are using.
  7759.  
  7760.  Syntax:
  7761.        test
  7762.  
  7763. 
  7764. File: gnuplot.info, Node: update, Prev: test, Up: Commands
  7765.  
  7766.  This command writes the current values of the fit parameters into the given
  7767.  file, formatted as an initial-value file (as described in the `fit`s
  7768.  (*note fit:: )ection). This is useful for saving the current values for later
  7769.  use or for restarting a converged or stopped fit.
  7770.  
  7771.  Syntax:
  7772.        update <filename> {<filename>}
  7773.  
  7774.  If a second filename is supplied, the updated values are written to this
  7775.  file, and the original parameter file is left unmodified.
  7776.  
  7777.  Otherwise, if the file already exists, `gnuplot` (*note gnuplot:: ) first
  7778.  renames it by appending `.old` and then opens a new file.  That is, "`update
  7779.  'fred'`" behaves the same as "`!rename fred fred.old; update 'fred.old'
  7780.  'fred'`". [On DOS and other systems that use the twelve-character
  7781.  "filename.ext" naming convention, "ext" will be "`old`" and "filename" will be
  7782.  related (hopefully recognizably) to the initial name.  Renaming is not done at
  7783.  all on VMS systems, since they use file-versioning.]
  7784.  
  7785.  Please see `fit` for more information.
  7786.  
  7787. 
  7788. File: gnuplot.info, Node: Graphical User Interfaces, Prev: Commands, Up: Top, Next: Bugs
  7789.  
  7790.  Several graphical user interfaces have been written for `gnuplot`
  7791.  (*note gnuplot:: ) and one for win32 is included in this distribution.  In
  7792.  addition, there is a Macintosh interface at
  7793.         ftp://ftp.ee.gatech.edu/pub/mac/gnuplot and several X11 interfaces
  7794.  include three Tcl/Tk located at the usual Tcl/Tk repositories.
  7795.  
  7796.  
  7797. 
  7798. File: gnuplot.info, Node: Bugs, Prev: Graphical User Interfaces, Up: Top, Next: Old_bugs
  7799.  
  7800.  Floating point exceptions (floating point number too large/small, divide by
  7801.  zero, etc.) may occasionally be generated by user defined functions.  Some of
  7802.  the demos in particular may cause numbers to exceed the floating point range.
  7803.  Whether the system ignores such exceptions (in which case `gnuplot`
  7804.  (*note gnuplot:: ) labels the corresponding point as undefined) or aborts
  7805.  `gnuplot` depends on the compiler/runtime environment.
  7806.  
  7807.  The bessel functions do not work for complex arguments.
  7808.  
  7809.  The gamma function does not work for complex arguments.
  7810.  
  7811.  As of `gnuplot` version 3.7, all development has been done using ANSI C.
  7812.  With current operating system, compiler, and library releases, the OS
  7813.  specific bugs documented in release 3.5, now relegated to `old_bugs`, may
  7814.  no longer be relevant.
  7815.  
  7816.  Bugs reported since the current release may be located via the official
  7817.  distribution site:
  7818.         ftp://ftp.dartmouth.edu/pub/gnuplot
  7819.        http://www.cs.dartmouth.edu/gnuplot_info.html
  7820.  
  7821.  Please e-mail any bugs to bug-gnuplot@dartmouth.edu.
  7822.  
  7823. * Menu:
  7824.  
  7825. * Old_bugs::
  7826.  
  7827. 
  7828. File: gnuplot.info, Node: Old_bugs, Prev: Bugs, Up: Bugs
  7829.  
  7830.  There is a bug in the stdio library for old Sun operating systems (SunOS
  7831.  Sys4-3.2).  The "%g" format for 'printf' sometimes incorrectly prints numbers
  7832.  (e.g., 200000.0 as "2").  Thus, tic mark labels may be incorrect on a Sun4
  7833.  version of `gnuplot` (*note gnuplot:: ).  A work-around is to rescale the data
  7834.  or use the set format` command to change the tic mark format to "%7.0f" or
  7835.  some other appropriate format.  This appears to have been fixed in SunOS 4.0.
  7836.  
  7837.  Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2 and
  7838.  SunOS 4.0, the 'sscanf' routine incorrectly parses "00 12" with the format
  7839.  "%f %f" and reads 0 and 0 instead of 0 and 12.  This affects data input.  If
  7840.  the data file contains x coordinates that are zero but are specified like
  7841.  '00', '000', etc, then you will read the wrong y values.  Check any data
  7842.  files or upgrade the SunOS.  It appears to have been fixed in SunOS 4.1.1.
  7843.  
  7844.  Suns appear to overflow when calculating exp(-x) for large x, so `gnuplot`
  7845.  gets an undefined result.  One work-around is to make a user-defined function
  7846.  like e(x) = x<-500 ? 0 : exp(x).  This affects plots of Gaussians (exp(-x*x))
  7847.  in particular, since x*x grows quite rapidly.
  7848.  
  7849.  Microsoft C 5.1 has a nasty bug associated with the %g format for 'printf'.
  7850.  When any of the formats "%.2g", "%.1g", "%.0g", "%.g" are used, 'printf' will
  7851.  incorrectly print numbers in the range 1e-4 to 1e-1.  Numbers that should be
  7852.  printed in the %e format are incorrectly printed in the %f format, with the
  7853.  wrong number of zeros after the decimal point.  To work around this problem,
  7854.  use the %e or %f formats explicitly.
  7855.  
  7856.  `gnuplot`, when compiled with Microsoft C, did not work correctly on two VGA
  7857.  displays that were tested.  The CGA, EGA and VGA drivers should probably be
  7858.  rewritten to use the Microsoft C graphics library.  `gnuplot` compiled with
  7859.  Borland C++ uses the Turbo C graphics drivers and does work correctly with
  7860.  VGA displays.
  7861.  
  7862.  VAX/VMS 4.7 C compiler release 2.4 also has a poorly implemented %g format
  7863.  for 'printf'.  The numbers are printed numerically correct, but may not be in
  7864.  the requested format.  The K&R second edition says that for the %g format, %e
  7865.  is used if the exponent is less than -4 or greater than or equal to the
  7866.  precision.  The VAX uses %e format if the exponent is less than -1.  The VAX
  7867.  appears to take no notice of the precision when deciding whether to use %e or
  7868.  %f for numbers less than 1.  To work around this problem, use the %e or %f
  7869.  formats explicitly.  From the VAX C 2.4 release notes: e,E,f,F,g,G  Result
  7870.  will always contain a decimal  point.  For g and G, trailing zeros will not
  7871.  be removed from the result.
  7872.  
  7873.  VAX/VMS 5.2 C compiler release 3.0 has a slightly better implemented %g
  7874.  format than release 2.4, but not much.  Trailing decimal points are now
  7875.  removed, but trailing zeros are still not removed from %g numbers in
  7876.  exponential format.
  7877.  
  7878.  The two preceding problems are actually in the libraries rather than in the
  7879.  compilers.  Thus the problems will occur whether `gnuplot` is built using
  7880.  either the DEC compiler or some other one (e.g. the latest gcc).
  7881.  
  7882.  ULTRIX X11R3 has a bug that causes the X11 driver to display "every other"
  7883.  graph.  The bug seems to be fixed in DEC's release of X11R4 so newer releases
  7884.  of ULTRIX don't seem to have the problem.  Solutions for older sites include
  7885.  upgrading the X11 libraries (from DEC or direct from MIT) or defining
  7886.  ULTRIX_KLUDGE when compiling the x11.trm file.  Note that the kludge is not
  7887.  an ideal fix, however.
  7888.  
  7889.  The constant HUGE was incorrectly defined in the NeXT OS 2.0 operating
  7890.  system.  HUGE should be set to 1e38 in plot.h. This error has been corrected
  7891.  in the 2.1 version of NeXT OS.
  7892.  
  7893.  Some older models of HP plotters do not have a page eject command 'PG'.  The
  7894.  current HPGL driver uses this command in HPGL_reset.  This may need to be
  7895.  removed for these plotters.  The current PCL5 driver uses HPGL/2 for text as
  7896.  well as graphics.  This should be modified to use scalable PCL fonts.
  7897.  
  7898.  On the Atari version, it is not possible to send output directly to the
  7899.  printer (using `/dev/lp` as output file), since CRs are added to LFs in
  7900.  binary output.  As a work-around, write the output to a file and copy it to
  7901.  the printer afterwards using a shell command.
  7902.  
  7903.  On AIX 4, the literal 'NaNq' in a datafile causes the special internal value
  7904.  'not-a-number' to be stored, rather than setting an internal 'undefined'
  7905.  flag.  A workaround is to use `set missing 'NaNq'`.
  7906.  
  7907.  There may be an up-to-date list of bugs since the release on the WWW page:
  7908.        http://www.cs.dartmouth.edu/gnuplot_info.html
  7909.  
  7910.  Please report any bugs to bug-gnuplot@dartmouth.edu.
  7911.